Thanks Peter,

I still wonder why it thinks it's unbalanced...

The se's of the contrasts are different than the se's of the means, 
which is the point of se=T in model.tables (type "means") I would have 
thought. No big deal though, the following code makes a nice table with 
the se's of the means to use in further CI's be it t's or Bonferroni:

kidney.mse <- kidney.anova[length(row.names(kidney.anova)),3]
means=se=means.a=se.a=means.b=se.b=rep(0,6)
kidney.means <- data.frame(means,se,means.a,se.a,means.b,se.b,a,b)
for (i in 1:6){
  kidney.means[i,1] = mean(kidney$dhosp.trans[kidney$a.b==i])
  if (i < 4){
    if (i < 3){
      kidney.means[i,3] = mean(kidney$dhosp.trans[kidney$duration==i])
      kidney.means[i,4] = 
kidney.mse/length(kidney$duration[kidney$duration==i])
    }
    kidney.means[i,5] = mean(kidney$dhosp.trans[kidney$wgain==i])
    kidney.means[i,6] = kidney.mse/length(kidney$wgain[kidney$wgain==i])
    kidney.means[i,7] = 1
    kidney.means[i,8] = i
  }
  if (i > 3){
    kidney.means[i,7] = 2
    kidney.means[i,8] = i-3
  }
  kidney.means[i,2] = kidney.mse/length(kidney$dhosp.trans[kidney$a.b==i])
}

 > kidney.means
      means         se   means.a        se.a   means.b        se.b a b
1 0.4434824 0.01012537 0.7867166 0.003375125 0.4208548 0.005062687 1 1
2 0.8099675 0.01012537 0.6151953 0.003375125 0.6954658 0.005062687 1 2
3 1.1066998 0.01012537 0.0000000 0.000000000 0.9865472 0.005062687 1 3
4 0.3982271 0.01012537 0.0000000 0.000000000 0.0000000 0.000000000 2 1
5 0.5809641 0.01012537 0.0000000 0.000000000 0.0000000 0.000000000 2 2
6 0.8663947 0.01012537 0.0000000 0.000000000 0.0000000 0.000000000 2 3

Thanks again

Peter Alspach wrote:

>Damián
>
>I asked a similar question a few months ago (3 August 2004):
>
>  
>
>>temp.aov <- aov(S~rep+trt1*trt2*trt3, data=dummy.data)
>>model.tables(temp.aov, type='mean', se=T)
>>
>>Returns the means, but states "Design is unbalanced - use se.contrasts
>>for se's" which is a little surprising since the design is balanced. 
>>    
>>
>
>To which Prof Ripley replied: If you used the default treatment contrasts, it 
>is not.  Try Helmert
>contrasts with aov().
>
>If I recall correctly, following Prof Ripley's suggestion led aov() to accept 
>the design was balanced, but model.tables() still did not (but that could have 
>been my error).  However, se.contrast() worked.
>
>Cheers ........
>
>Peter Alspach
>
>
>
>  
>
>>>>Damián Cirelli <[EMAIL PROTECTED]> 02/12/04 09:50:13 >>>
>>>>        
>>>>
>Hi all,
>I'm new to R and have the following problem:
>I have a 2 factor design (a has 2 levels, b has 3 levels). I have an
>object kidney.aov which is an aov(y ~ a*b), and when I ask for
>model.tables(kidney.avo, se=T) I get the following message along with
>the table of effects:
>
>Design is unbalanced - use se.contrast() for se's
>
>but the design is NOT unbalanced... each fator level combination has the
>same n
>
>I' d appreciate any help.
>Thanks.
>
>______________________________________________
>[EMAIL PROTECTED] mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>______________________________________________________
>
>The contents of this e-mail are privileged and/or confidential to the
>named recipient and are not to be used by any other person and/or
>organisation. If you have received this e-mail in error, please notify
>the sender and delete all material pertaining to this e-mail.
>______________________________________________________
>
>  
>

        [[alternative HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to