[R] Use nparcomp function from nparcomp library to run post hoc
David Winsemius
dwinsemius at comcast.net
Sat Apr 30 13:12:52 CEST 2011
On Apr 29, 2011, at 7:17 PM, Jun Shen wrote:
> Hi, Dennis,
>
> Thanks for the reply. I tried to upgrade to R 2.13.0. Then when I
> tried to
> load the library(nparcomp), I got an error
>
> Error: package 'mvtnorm' is not installed for 'arch=i386'
>
> What does that mean? Thanks.
>
You can see from Dennis' console output that 4 other packages are
loaded when nparcomp is loaded. You have apparently not installed all
of the needed packages for the new version of R. There is an argument
to the install.packages function that will check for dependencies. Or
perhaps you need to set that option in a GUI interface.
--
David.
> Jun
>
> On Fri, Apr 29, 2011 at 5:49 PM, Dennis Murphy <djmuser at gmail.com>
> wrote:
>
>> Hi:
>>
>> Is this the function nparcomp() in the nparcomp package or the one
>> from the mutoss package? When using functions from packages, it is
>> useful to indicate the package name. I'm assuming you're using the
>> nparcomp package, because your code worked for me when that package
>> was loaded:
>>
>>> library(nparcomp)
>> Loading required package: multcomp
>> Loading required package: mvtnorm
>> Loading required package: survival
>> Loading required package: splines
>>> nparcomp(Ulceration~Group,data=test,type='Dunnett',control='Non-
>>> treated')
>>
>> Nonparametric Multiple Comparison Procedure based on relative
>> contrast effects , Type of Contrast : Dunnett
>> NOTE:
>> *-------------------Weight Matrix------------------*
>> - Weight matrix for choosen contrast based on all-pairs comparisons
>>
>> *-----------Analysis of relative effects-----------*
>> - Simultaneous Confidence Intervals for relative effects p(i,j)
>> with confidence level 0.95
>> - Method = Multivariate Delta-Method (Logit)
>> - p-Values for H_0: p(i,j)=1/2
>>
>> *----------------Interpretation--------------------*
>> p(a,b) > 1/2 : b tends to be larger than a
>> *--------------Mult.Distribution-------------------*
>> - Equicoordinate Quantile
>> - Global p-Value
>> *--------------------------------------------------*
>> $weight.matrix
>>
>> < snipped for brevity - all zeros >
>>
>> $Data.Info
>> Sample Size
>> 1 Duoderm 24
>> 2 Fibrase 24
>> 3 Kollagenase 24
>> 4 Non-treated 24
>> 5 Stimulen 24
>> 6 Vehicle 24
>>
>> $Analysis.of.relative.effects
>> Comparison rel.effect confidence.interval t.value
>> 1 p(Non-treated,Duoderm) 0.5 [ 0.499 ; 0.501 ] 0
>> 2 p(Non-treated,Fibrase) 0.5 [ 0.499 ; 0.501 ] 0
>> 3 p(Non-treated,Kollagenase) 0.5 [ 0.499 ; 0.501 ] 0
>> 4 p(Non-treated,Stimulen) 0.5 [ 0.499 ; 0.501 ] 0
>> 5 p(Non-treated,Vehicle) 0.5 [ 0.499 ; 0.501 ] 0
>> p.value.adjusted p.value.unadjusted
>> 1 1 1
>> 2 1 1
>> 3 1 1
>> 4 1 1
>> 5 1 1
>>
>> $Mult.Distribution
>> Quantile p.Value.global
>> 1 2.568766 1
>>
>> $Correlation
>> [1] NA
>>
>> A graphic also appears indicating zero effect, which is what one
>> would
>> expect since Ulceration = 5 for every observation in the data frame.
>>
>>> sessionInfo()
>> R version 2.13.0 (2011-04-13)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>>
>> locale:
>> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
>> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
>> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
>> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
>> [9] LC_ADDRESS=C LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] splines stats graphics grDevices utils datasets
>> methods
>> [8] base
>>
>> other attached packages:
>> [1] nparcomp_1.0-1 multcomp_1.2-5 survival_2.36-9 mvtnorm_0.9-999
>> [5] sos_1.3-0 brew_1.0-6 plyr_1.5.2
>>
>> loaded via a namespace (and not attached):
>> [1] tcltk_2.13.0 tools_2.13.0
>>
>> Check your version of R and the nparcomp package against this. If you
>> have an older version of R or nparcomp, perhaps an upgrade is
>> sufficient to fix the problem.
>>
>> HTH,
>> Dennis
>>
>> On Fri, Apr 29, 2011 at 2:49 PM, Jun Shen <jun.shen.ut at gmail.com>
>> wrote:
>>> Dear list,
>>>
>>> I tried to use the nparcomp to run some post hoc non-parametric
>> comparison
>>> and got and error.
>>>
>>> Error in uniroot(pfct, interval = interval) :
>>> f() values at end points not of opposite sign
>>>
>>> Appreciate any comments.
>>>
>>> the command line:
>>>
>>>> nparcomp(Ulceration~Group,data=test,type='Dunnett',control='Non-
>>>> treated')
>>>
>>>
>>> Jun
>>> ===================================================================
>>> data as follows
>>>
>>> structure(list(Group = c("Duoderm", "Duoderm", "Duoderm", "Duoderm",
>>> "Duoderm", "Duoderm", "Duoderm", "Duoderm", "Duoderm", "Duoderm",
>>> "Duoderm", "Duoderm", "Duoderm", "Duoderm", "Duoderm", "Duoderm",
>>> "Duoderm", "Duoderm", "Duoderm", "Duoderm", "Duoderm", "Duoderm",
>>> "Duoderm", "Duoderm", "Fibrase", "Fibrase", "Fibrase", "Fibrase",
>>> "Fibrase", "Fibrase", "Fibrase", "Fibrase", "Fibrase", "Fibrase",
>>> "Fibrase", "Fibrase", "Fibrase", "Fibrase", "Fibrase", "Fibrase",
>>> "Fibrase", "Fibrase", "Fibrase", "Fibrase", "Fibrase", "Fibrase",
>>> "Fibrase", "Fibrase", "Kollagenase", "Kollagenase", "Kollagenase",
>>> "Kollagenase", "Kollagenase", "Kollagenase", "Kollagenase",
>> "Kollagenase",
>>> "Kollagenase", "Kollagenase", "Kollagenase", "Kollagenase",
>> "Kollagenase",
>>> "Kollagenase", "Kollagenase", "Kollagenase", "Kollagenase",
>> "Kollagenase",
>>> "Kollagenase", "Kollagenase", "Kollagenase", "Kollagenase",
>> "Kollagenase",
>>> "Kollagenase", "Non-treated", "Non-treated", "Non-treated",
>> "Non-treated",
>>> "Non-treated", "Non-treated", "Non-treated", "Non-treated",
>> "Non-treated",
>>> "Non-treated", "Non-treated", "Non-treated", "Non-treated",
>> "Non-treated",
>>> "Non-treated", "Non-treated", "Non-treated", "Non-treated",
>> "Non-treated",
>>> "Non-treated", "Non-treated", "Non-treated", "Non-treated",
>> "Non-treated",
>>> "Stimulen", "Stimulen", "Stimulen", "Stimulen", "Stimulen",
>>> "Stimulen",
>>> "Stimulen", "Stimulen", "Stimulen", "Stimulen", "Stimulen",
>>> "Stimulen",
>>> "Stimulen", "Stimulen", "Stimulen", "Stimulen", "Stimulen",
>>> "Stimulen",
>>> "Stimulen", "Stimulen", "Stimulen", "Stimulen", "Stimulen",
>>> "Stimulen",
>>> "Vehicle", "Vehicle", "Vehicle", "Vehicle", "Vehicle", "Vehicle",
>>> "Vehicle", "Vehicle", "Vehicle", "Vehicle", "Vehicle", "Vehicle",
>>> "Vehicle", "Vehicle", "Vehicle", "Vehicle", "Vehicle", "Vehicle",
>>> "Vehicle", "Vehicle", "Vehicle", "Vehicle", "Vehicle", "Vehicle"
>>> ), Ulceration = c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
>>> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
>>> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
>>> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
>>> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
>>> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
>>> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
>>> 5, 5, 5), Inflamation = c(3, 4, 3, 2, 3, 3, 4, 4, 2, 2, 3, 3,
>>> 3, 3, 3, 3, 3, 4, 3, 3, 3, 4, 3, 3, 2, 3, 3, 4, 3, 3, 2, 4, 4,
>>> 4, 4, 4, 4, 4, 3, 3,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, 3, 3, 3, NA, 4, 4, 4, 4, 3, 4, 3, 3, 3, 3, 3, 4, 2, 4, 3,
>>> 4, 4, 3, 4, 4, 2, 3, 2, 3, 3, 3, 3, 4, 4, 4, 4, 3, 3, 3, 3, 3,
>>> 4, 3, 3, 4, 4, 4, 4, 3, 3, 4, 3, 3, 4, 4, 4, 4, 3, 4, 4), Fibrosis
>>> = c(3,
>>> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
>>> 3, 3, 3, 3, 3, 3, 3, 3, NA, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
>>> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
>>> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3,
>>> 3, 3, 3, 3, NA, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 2, 3, 3,
>>> 3, 3, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3,
>>> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), Total =
>>> c(25,
>>> 26, 25, 22, 24, 22, 26, 27, 23, 21, 24, 21, 22, 23, 25, 24, 25,
>>> 26, 23, 23, 24, 24, 24, 24, 21, 24, 20, 24, 24, 22, 12, 25, 25,
>>> 25, 26, 26, 26, 24, 22, 21, 24, 22, 24, 22, 25, 23, 25, 24, 22,
>>> 21, 24, 21, 24, 24, 25, 23, 25, 23, 24, 24, 24, 24, 20, 21, 24,
>>> 26, 21, 22, 25, 23, 21, 24, 23, 24, 23, 22, 23, 23, 22, 23, 25,
>>> 23, 23, 24, 24, 24, 23, 22, 17, 25, 25, 21, 25, 22, 25, 19, 24,
>>> 23, 22, 23, 21, 16, 22, 20, 25, 22, 22, 24, 25, 19, 21, 20, 25,
>>> 23, 20, 22, 25, 24, 23, 25, 24, 22, 22, 21, 23, 23, 23, 20, 24,
>>> 23, 24, 23, 23, 22, 24, 23, 23, 24, 26, 25, 23, 23, 24,
>>> 25)), .Names =
>>> c("Group",
>>> "Ulceration", "Inflamation", "Fibroplasia",
>> "Fibrosis.and.Adexnal.Atrophy",
>>> "Inflammation", "Fibroplasia.1", "Fibrosis", "Total"), row.names =
>>> c(NA,
>>> 144L), class = "data.frame")
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list