Hi Folks, I have repeated measures for data on association time (under 2 acoustic condtions) in male and female frogs as they grow to adulthood (6 timepoints). Thus, two within-subject variables (Acoustic Condition: 2 levels, Timepoint: 6 levels) and one between-subject variable (Sex:male or female). I am pretty sure my distributions depart from normality but I would first like to simply run a RM anova on the data. My problem is that when I do this I generate different values of F for my main effects and interaction when I do the analysis in [R] and SPSS - so I don't know which one to believe. Here is my code in R:>mydata.tab=read.delim("mydata.txt", header=T) #read in my data>mydata.tab$Timepoint=as.factor(mydata.tab$Timepoint) #col headingsare factors so df are correct>mydata.tab$Acx.Cond=as.factor(mydata.tab$Acx.Cond)>mydata.tab$Sex=as.factor(mydata.tab$Sex)> aov.F=aov(Targ.Assoc.Time~(Timepoint*Acx.Cond*Sex) + Error(Subject/(Timepoint*Acx.Cond))+(Sex), data=mydata.tab)#run aov where i look at the main effects of Timepoint, Acoustic Condition and Sex as well as all the interactions therein on the amount of time a frog spends associating with the target sound. Include anything to do with Subject in the error term. Does this look right for a Repeated Measures ANOVA, or am I missing something to make it RM and that explains the large discrepancies in my F-values between [R] and SPSS? As soon as I get this canonical aov code figured out I want to derive my p-values by bootstrapping my F distributions, but first I need those canonical F's. Thanks -Alex -- Alexander T Baugh Section of Integrative Biology Univ. of Texas at Austin C0930 Austin, TX 78712 http://darktropic.blogspot.com/
Alex Baugh wrote:> Hi Folks, > > I have repeated measures for data on association time (under 2 > acoustic condtions) in male and female frogs as they grow to adulthood > (6 timepoints). Thus, two within-subject variables (Acoustic > Condition: 2 levels, Timepoint: 6 levels) and one between-subject > variable (Sex:male or female). > > I am pretty sure my distributions depart from normality but I would > first like to simply run a RM anova on the data. My problem is that > when I do this I generate different values of F for my main effects > and interaction when I do the analysis in [R] and SPSS - so I don't > know which one to believe. > > Here is my code in R: > > > >> mydata.tab=read.delim("mydata.txt", header=T) #read in my data >> > > >> mydata.tab$Timepoint=as.factor(mydata.tab$Timepoint) #col headings >> > are factors so df are correct > > >> mydata.tab$Acx.Cond=as.factor(mydata.tab$Acx.Cond) >> > > >> mydata.tab$Sex=as.factor(mydata.tab$Sex) >> > > >> aov.F=aov(Targ.Assoc.Time~(Timepoint*Acx.Cond*Sex) + Error(Subject/(Timepoint*Acx.Cond))+(Sex), data=mydata.tab) >> > > #run aov where i look at the main effects of Timepoint, Acoustic > Condition and Sex as well as all the interactions therein on the > amount of time a frog spends associating with the target sound. > Include anything to do with Subject in the error term. > > > > > Does this look right for a Repeated Measures ANOVA, or am I missing > something to make it RM and that explains the large discrepancies in > my F-values between [R] and SPSS? > >Nothing obviously wrong to my eyes. There's a stray (Sex) term, but I don't think that actually does anything. I assume that your data are balanced and complete. Apart from that it coincides with my expectation of what SPSS would do. You'd give us a better chance of helping if you actually included some output on the two systems. If you approach this as a multivariate linear model (with 12-dimensional response), then you can also use the features of anova.mlm (the example on the help page is quite similar to your setup). This takes a bit more work, but it give the "epsilon" corrections that people like to calculate for these models.> As soon as I get this canonical aov code figured out I want to derive > my p-values by bootstrapping my F distributions, but first I need > those canonical F's. > > > Thanks > -Alex > >-- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Two things: 1. the + Sex term is superfluous 2. the variable Subject needs to be a Factor, not a vector (as I suspect it currently is). That is, add: mydata.tab$Subject=as.factor(mydata.tab$Subject) in the preamble before the aov call, and all should be fine. On 29-Apr-08, at 4:00 AM, r-help-request at r-project.org wrote:> Hi Folks, > > I have repeated measures for data on association time (under 2 > acoustic condtions) in male and female frogs as they grow to adulthood > (6 timepoints). Thus, two within-subject variables (Acoustic > Condition: 2 levels, Timepoint: 6 levels) and one between-subject > variable (Sex:male or female). > > I am pretty sure my distributions depart from normality but I would > first like to simply run a RM anova on the data. My problem is that > when I do this I generate different values of F for my main effects > and interaction when I do the analysis in [R] and SPSS - so I don't > know which one to believe. > > Here is my code in R: > > >> mydata.tab=read.delim("mydata.txt", header=T) #read in my data > >> mydata.tab$Timepoint=as.factor(mydata.tab$Timepoint) #col headings > are factors so df are correct > >> mydata.tab$Acx.Cond=as.factor(mydata.tab$Acx.Cond) > >> mydata.tab$Sex=as.factor(mydata.tab$Sex) > >> aov.F=aov(Targ.Assoc.Time~(Timepoint*Acx.Cond*Sex) + Error(Subject/ >> (Timepoint*Acx.Cond))+(Sex), data=mydata.tab) > > #run aov where i look at the main effects of Timepoint, Acoustic > Condition and Sex as well as all the interactions therein on the > amount of time a frog spends associating with the target sound. > Include anything to do with Subject in the error term. > > > > > Does this look right for a Repeated Measures ANOVA, or am I missing > something to make it RM and that explains the large discrepancies in > my F-values between [R] and SPSS? > > > As soon as I get this canonical aov code figured out I want to derive > my p-values by bootstrapping my F distributions, but first I need > those canonical F's. > > > Thanks > -Alex > > -- > Alexander T Baugh > Section of Integrative Biology > Univ. of Texas at Austin C0930 > Austin, TX 78712 > http://darktropic.blogspot.com/-- Please avoid sending me Word or PowerPoint attachments. See <http://www.gnu.org/philosophy/no-word-attachments.html> -Dr. John R. Vokey