s-news
[Top] [All Lists]

multicomp function problems

To: s-news@lists.biostat.wustl.edu
Subject: multicomp function problems
From: "Chris Gast" <cmgast@gmail.com>
Date: Wed, 10 Jan 2007 09:09:17 -0800
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=JXHE1e5TwgnnZ+Pzf4MqSRL5jAfd1boGBkRvfI7a/sL6AVGE4jD+EaYugBbKkJwOvDadooFY42QWAhfMPUcgAvwsKAkf/VOp4bQawf3eqTBVHhu+//G3MZd4XOl+1pKTcWJ0Xe7Ij69nontNctFlA48rS4gPbgAVGVEFCE9LGxw=
Hello everyone,

I'm new to the list, but could really use some assistance.

My problem concerns the multicomp() function S-Plus (version 7.0).

I am trying to generate some random data, assign them to groups, run a
one-way anova with group as the factor, and then perform Dunnett's
method for multiple comparisons, as part of a simulation I am
performing.  I cannot seem to get the multicomp function working
properly.

Can anyone take a look at it, and offer some hints or guidance?  I
would be much obliged.  The code, as well as the error output is
pasted below.

dunnettsim=function(seedval,groups,n,a){
        
        #seedval=5; n=c(5,5,5,4); groups=4; a=.05; set.seed(seedval)
        
alphabet=c("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
        
        groupvar=matrix("z",max(n),groups)
        
        for(j in 1:groups){
                for(i in 1:n[j]){
                        
                        groupvar[i,j]=alphabet[j]
                }
        }
        
        dat=rnorm(sum(n))

        groupvec=rep("a",n[1])
        for(k in 2:groups){
                groupvec=c(groupvec,groupvar[,k])
        }
        
        groupvec=as.factor(groupvec[groupvec!="z"])
        #groupvec=groupvec[groupvec!="z"]
        output=lm(dat~groupvec)

        multicomp.lm(output,focus="a",comparisons="mcc",alpha=a, 
method="dunnett")

}

dunnettsim(seedval=5,groups=4,n=c(5,5,5,4),a=.05)


OUTPUT:

Problem in multicomp.lm(output, focus = "a", comparisons = "mcc",
alpha = a, method = "dunnett"): focus = a must be one of the factors =
groupvec


--
Chris Gast
cmgast@gmail.com
(206) 271-6418

<Prev in Thread] Current Thread [Next in Thread>
  • multicomp function problems, Chris Gast <=