Re: [R] re peated measures

2009-09-25 Thread pompon

Hi,

Thank you. 
It was that.

Julien.



Tal Galili wrote:
> 
> check for missing values.
> Tal
> 
> 
> 
> On Wed, Sep 23, 2009 at 3:27 PM, pompon  wrote:
> 
>>
>> Hi,
>>
>> I am performing a repeated measures 2-way ANOVA  to assess the influence
>> of
>> plant and leaf on aphid fecundity. Fecundity is measured for each aphid
>> on
>> a
>> single leaf.
>> Here is what I typed.
>>
>> wingless <- reshape(Wingless,
>>varying =
>>
>> list(c("d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14","d15","d16")),
>>v.names = c("fecundity"), timevar = "time",
>>direction = "long")
>>
>> wingless.aov <- aov(fecundity ~ factor(time) * clip.cage * plant +
>> Error(factor(id)), data = wingless)
>>
>> summary(wingless.aov)
>>
>> and I obtained
>>
>> Error: factor(id)
>>   Df Sum Sq Mean Sq F value  Pr(>F)
>> factor(time)4 56.789  14.197  3.0613 0.05925 .
>> clip.cage   1 14.149  14.149  3.0509 0.10621
>> plant   1  3.251   3.251  0.7010 0.41880
>> factor(time):clip.cage  1  0.304   0.304  0.0655 0.80240
>> clip.cage:plant 1 17.114  17.114  3.6903 0.07880 .
>> Residuals  12 55.652   4.638
>> ---
>> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>>
>> Error: Within
>>  Df Sum Sq Mean Sq F value  Pr(>F)
>> factor(time)  16 340.83   21.30 11.5222 < 2e-16 ***
>> factor(time):clip.cage16  27.341.71  0.9242 0.54195
>> factor(time):plant16  46.362.90  1.5673 0.07783 .
>> factor(time):clip.cage:plant  16  24.501.53  0.8281 0.65304
>> Residuals255 471.441.85
>> ---
>> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>>
>> I don't understand why I have the factor(time) inmy between subject
>> results,
>> whereas with a similar set of data I don't.
>>
>> Thank you very much,
>> Julien Pompon.
>> --
>> View this message in context:
>> http://www.nabble.com/repeated-measures-tp25531110p25531110.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> __
>> R-help@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.
>>
> 
> 
> 
> -- 
> --
> 
> 
> My contact information:
> Tal Galili
> Phone number: 972-50-3373767
> FaceBook: Tal Galili
> My Blogs:
> http://www.r-statistics.com/
> http://www.talgalili.com
> http://www.biostatistics.co.il
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/repeated-measures-tp25531110p25610539.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] re peated measures

2009-09-23 Thread pompon

Hi,

I am performing a repeated measures 2-way ANOVA  to assess the influence of
plant and leaf on aphid fecundity. Fecundity is measured for each aphid on a
single leaf.
Here is what I typed.

wingless <- reshape(Wingless,
varying =
list(c("d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14","d15","d16")),
v.names = c("fecundity"), timevar = "time",
direction = "long")

wingless.aov <- aov(fecundity ~ factor(time) * clip.cage * plant +
Error(factor(id)), data = wingless)

summary(wingless.aov)

and I obtained

Error: factor(id)
   Df Sum Sq Mean Sq F value  Pr(>F)  
factor(time)4 56.789  14.197  3.0613 0.05925 .
clip.cage   1 14.149  14.149  3.0509 0.10621  
plant   1  3.251   3.251  0.7010 0.41880  
factor(time):clip.cage  1  0.304   0.304  0.0655 0.80240  
clip.cage:plant 1 17.114  17.114  3.6903 0.07880 .
Residuals  12 55.652   4.638  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Error: Within
  Df Sum Sq Mean Sq F value  Pr(>F)
factor(time)  16 340.83   21.30 11.5222 < 2e-16 ***
factor(time):clip.cage16  27.341.71  0.9242 0.54195
factor(time):plant16  46.362.90  1.5673 0.07783 .  
factor(time):clip.cage:plant  16  24.501.53  0.8281 0.65304
Residuals    255 471.441.85
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

I don't understand why I have the factor(time) inmy between subject results,
whereas with a similar set of data I don't. 

Thank you very much,
Julien Pompon.
-- 
View this message in context: 
http://www.nabble.com/repeated-measures-tp25531110p25531110.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] anova(cph(..) output

2009-05-19 Thread pompon

Hi,

Thank you very much for the answer.

However, I have still some misunderstandings.
from the output, can we say that plant and leaf age are significant but not
their interaction?
And the last question I promise, what would you advise me to write in the
paper to explain the different method and ackonwledge for the df?

Thank you again,
julien.

 

Frank E Harrell Jr wrote:
> 
> pompon wrote:
>> Hello,
>> 
>> I am a beginner in R and statistics, so my question may be trivial. Sorry
>> in
>> advance.
>> I performed a Cox proportion hazard regression with 2 categorical
>> variables
>> with cph{design}. Then an anova on the results.
>> the output is 
>> 
>>> anova(cph(surv(survival, censor) ~ plant + leaf.age + plant*leaf.age,
>>> Mpnymph)
>> 
>> Wald Statistics  Response: Surv(survival,
>> censored) 
>> 
>>  FactorChi-Square
>> d.f. P 
>>  plant  (Factor+Higher Order Factors) 96.96 12   <.0001
>>   All Interactions   10.58 
>> 6   0.1022
>>  leaf.age  (Factor+Higher Order Factors)  29.11  7   0.0001
>>   All Interactions 10.58 
>> 6   0.1022
>>  plant * leaf.age  (Factor+Higher Order Factors)  10.58  6   0.1022
>>  TOTAL   106.63 13   <.0001
>> 
>> What do "All interaction" stand for?
>> The real df of for plant is 6 and 1 for leaf.age. Then, which chi square
>> is
>> one for my main factors anf their interaction.
>> 
>> thank you,
>> Julien.
> 
> Julien,
> 
> I know what you mean when you say 'real df' but that's not the whole 
> story as plant has 6 more df by interacting with a single df variable. 
> There is no such thing as 'the' main effect test for plant.  The 12 df 
> test is unique and tests whether plant is associated with Y for any 
> level of leaf.age.
> 
> You can see exactly what is being tested by using various print options 
> for anova.Design, as described in the help file.  The "dots" option is 
> easy on the eyes.
> 
> Frank
> -- 
> Frank E Harrell Jr   Professor and Chair   School of Medicine
>   Department of Biostatistics   Vanderbilt University
> 
> __
> R-help@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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/anova%28cph%28..%29-output-tp23563818p23617483.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] anova(cph(..) output

2009-05-15 Thread pompon

Hello,

I am a beginner in R and statistics, so my question may be trivial. Sorry in
advance.
I performed a Cox proportion hazard regression with 2 categorical variables
with cph{design}. Then an anova on the results.
the output is 

> anova(cph(surv(survival, censor) ~ plant + leaf.age + plant*leaf.age,
> Mpnymph)

Wald Statistics  Response: Surv(survival, censored) 

 FactorChi-Square d.f. P
 
 plant  (Factor+Higher Order Factors) 96.96 12   <.0001
  All Interactions   10.58 
6   0.1022
 leaf.age  (Factor+Higher Order Factors)  29.11  7   0.0001
  All Interactions 10.58 
6   0.1022
 plant * leaf.age  (Factor+Higher Order Factors)  10.58  6   0.1022
 TOTAL   106.63 13   <.0001

What do "All interaction" stand for?
The real df of for plant is 6 and 1 for leaf.age. Then, which chi square is
one for my main factors anf their interaction.

thank you,
Julien.
-- 
View this message in context: 
http://www.nabble.com/anova%28cph%28..%29-output-tp23563818p23563818.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.