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 julien.pom...@agr.gc.ca 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.


Re: [R] re peated measures

2009-09-24 Thread Tal Galili
check for missing values.
Tal



On Wed, Sep 23, 2009 at 3:27 PM, pompon julien.pom...@agr.gc.ca 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.


[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
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.


[R] Re peated Measures (lme?)

2008-03-12 Thread francogrex

Hello, I have a general data analysis question. I recently visited a 
lab where they are testing a new treatment and they had done the 
experiment several times on different dates. They repeated the 
experiment 3-5 times per day. And then for practical reasons they 
repeated the whole procedure for 5 days.(they wanted a large sample 
size but practically they couldn't handle more than 5-10 experiments 
per day). However there might have been some extra variation between 
different days because the experimenter changed, although same 
procedure was being followed. 
Below are the data: 

Control data: 
Cday1=c(5,2,5,3,4); 
Cday2=c(2,1,3,1); 
Cday3=c(7,6,4,11,10); 
Cday4=c(5,13,8,4,10,6); 
Cday5=c(21,8, 5, 5,11); 

Treatment data: 
Tday1=c(17,11,25,21,16); 
Tday2=c(17,7,12); 
Tday3=c(16,18,4,20,18,25); 
Tday4=c(17,20,29,17,19); 
Tday5=c(14,31,28,34); 

Then they decided to do a paired t.test on the mean per day to 
measure whether 
they can detect a difference between the Control and the Treatment, 
something like: 
t.test(c(3.8,1.75,7.6,7.66,10),c(18,12,16.83,20.4,26.75),paired=T) 

But I thought there was something wrong in that procedure, something 
missing but I couldn't figure out what exactly, my feeling was that 
they were not capturing the variability in the measurements taken 
within one day. I thought maybe the solution could be in linear mixed 
effects models (lme) but could that be used to have some sort of a 
p-value (or other) to say there is a difference or not between the 
2 conditions. Or maybe other procedures? Any ideas? Thanks
 
-- 
View this message in context: 
http://www.nabble.com/Repeated-Measures-%28lme-%29-tp16012010p16012010.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.