tag:blogger.com,1999:blog-6710487119650146215.post729591615944645575..comments2017-12-06T02:21:54.627-07:00Comments on R Tutorial Series: R Tutorial Series: One-Way Repeated Measures ANOVAJohnhttp://www.blogger.com/profile/05331039307550313006noreply@blogger.comBlogger24125tag:blogger.com,1999:blog-6710487119650146215.post-10867501940757580732013-05-15T14:13:07.435-07:002013-05-15T14:13:07.435-07:00Hi,
Wonderful post here! Thanks so much for all ...Hi, <br /><br />Wonderful post here! Thanks so much for all of the tips and careful explanations. <br /><br />How can I tell if this model handles missing data points? If a subject is missing a measurement for one of the factors is the subject's data excluded from the repeated-measures analysis? <br /><br />Thanks,<br />JamesJameshttps://www.blogger.com/profile/13486100129616351487noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-511866506648037392012-12-16T03:03:57.219-07:002012-12-16T03:03:57.219-07:00Thanks for the post, it was really helpful!
One q...Thanks for the post, it was really helpful! <br />One question: do you need more subjects than factors to do a RM ANOVA? I keep getting this error when I try to run the ANOVA with less subjects than factors.<br /><br />Error in eigen(qr.coef(SSPE.qr, x$SSPH), symmetric = FALSE) : <br /> infinite or missing values in 'x'<br /><br />I don't think that this is the case in SPSS<br /><br />Cheers,<br />ClaireAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-18661821637428395932012-10-14T19:56:58.754-07:002012-10-14T19:56:58.754-07:00Hi John,
Thanks for the post. This is pretty info...Hi John,<br /><br />Thanks for the post. This is pretty informative. I have a question regarding a one way repeated measures anova (where the replicate was measured 2 times). I ran your version of R code on my data and came away with a very different (shorter) output. I've read that repeated measures should only be used for replicates measured 3 or more times have also read that RMANOVA can be used for replicates that have been measured 2 times (which is my case). Any idea on how to model the latter?<br /><br />Thanks so much,<br />CCristina Campbellhttps://www.blogger.com/profile/12321421426949148098noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-61992751071734462892012-06-05T08:50:52.620-07:002012-06-05T08:50:52.620-07:00Hi Luis. This is a note, not an error, and it also...Hi Luis. This is a note, not an error, and it also shows up every time I use the multivariate tests. I have not seen any reason that it cannot be ignored.John Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-40995134506959507052012-06-05T04:09:45.758-07:002012-06-05T04:09:45.758-07:00Hello John Quick,
I hope you are still here. By fo...Hello John Quick,<br />I hope you are still here. By following your steps I invariably get this error message after step 6 ('analysis'): <br />"model has only an intercept; equivalent type-III tests substituted". The analysis works when I use for 'ageModel' the function lm(ageBind ~ Subject). ('Subject' from the attached dataset). But the summary is then different. Please indicate my error!<br />Thank you<br />LuisLuishttps://www.blogger.com/profile/07114288372347622450noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-5605554785078002422012-05-01T07:24:25.050-07:002012-05-01T07:24:25.050-07:00I have seen this method used in other tutorials. T...I have seen this method used in other tutorials. The big difference that I notice is that the error term has to be manually specified, which introduces room for error and likely requires more expertise on the user's part. Also, I'm not certain that as rich of an output can be easily achieved with this method (e.g. the multivariate, univariate, and sphericity tests are all included in the tutorial output). Otherwise, I do not see any reasons why the results would differ for equivalent analyses.John M. Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-47163147137388270102012-04-30T12:03:31.920-07:002012-04-30T12:03:31.920-07:00What is the difference between your method verses ...What is the difference between your method verses the below method which is shown for repeated measures as well in many r books(In the below case you have to reorganize your data similar to the typical anova)?<br />> test<-aov(Interest~Age+Error(Subject/Age),data=data)<br />> summary(test)<br /><br />Error: Subject<br /> Df Sum Sq Mean Sq F value Pr(>F)<br />Residuals 1 5.411 5.411 <br /><br />Error: Subject:Age<br /> Df Sum Sq Mean Sq<br />Age 2 68.23 34.12<br /><br />Error: Within<br /> Df Sum Sq Mean Sq F value Pr(>F) <br />Age 2 24.65 12.323 18.59 2.06e-07 ***<br />Residuals 84 55.67 0.663 <br />---Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-21281319844382624562012-04-26T15:46:43.822-07:002012-04-26T15:46:43.822-07:00Hi Gabriel,
I'm not familiar with that varie...Hi Gabriel, <br /><br />I'm not familiar with that variety of repeated measures ANOVA and recommend that you consult professional sources regarding the implementation of statistical methods.<br /><br />JohnJohn M. Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-27785018972429253742012-04-23T02:15:56.406-07:002012-04-23T02:15:56.406-07:00Dear John M. Quick,
Could you give me a piece of a...Dear John M. Quick,<br />Could you give me a piece of advice to guide me to do the Repeated Measure ANOVA when the repeated factor is a quantitave factor?<br />Thank you a lot.Gabriel Riutortnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-85169102307899861832012-01-08T18:45:36.380-07:002012-01-08T18:45:36.380-07:00Hi thanks for the tutorial on One way Repeated mea...Hi thanks for the tutorial on One way Repeated measure ANOVA. I followed the steps exactly as you said but R is showing me an warning message like this"> analysis <- aov(ageModel, idata = ageFrame, idesign = ~ageFactor)<br /><br />Warning message:<br />In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :<br /> extra arguments idataidesign are just disregarded." how can i solve this issue.sumanhttps://www.blogger.com/profile/10321644303181790199noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-32724158366086672222011-10-04T07:18:28.268-07:002011-10-04T07:18:28.268-07:00Thank you for this tutorial. Could you perhaps jus...Thank you for this tutorial. Could you perhaps just explain the output a little bit moreAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-74990680421185987982011-07-03T14:30:27.387-07:002011-07-03T14:30:27.387-07:00From what you described, it does sound like you ha...From what you described, it does sound like you have the right data setup. You could use a subject, attractive, and not attractive column. See the first image in this tutorial. Your setup would look very similar, but with different headings and values. <br /><br />From your hypothesis, it sounds like you also want to compare the results by gender. In that case, you could run two separate one-way repeated measures ANOVAs, one for males and one for females.John M. Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-30950012811542598872011-07-03T12:13:27.374-07:002011-07-03T12:13:27.374-07:00Hi! Your tutorial is really helpful! But I still ...Hi! Your tutorial is really helpful! But I still have some questions!I conducted an experiment in which 25 men and 25 women listened to an attractive conversation and picked a photo (between a woman with red and a woman with green shirt) and next, they heard a neutral dialogue and did exactly the same, picked a photo between an woman in red and a woman in green. My hypothesis is that men are much more attracted to women in red in contrast to women. I was thinking of using repeated measures ANOVA as both men and women were 'examined' in the same experimental conditions. So, I reckon that my columns are: gender 2 levels (0 for males and 1 for females), attraction and non_attraction and I'll put in their rows 0 for not red and 1 for red! But I really don't know how I apply what I'm thinking to anova! and if that's the right way to show that each participant did this twice (two dialogues and 4 photos in total each of them). Can you help me???Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-3067642684042809852011-04-12T10:39:07.853-07:002011-04-12T10:39:07.853-07:00"Subsequently, we could conduct pairwise comp..."Subsequently, we could conduct pairwise comparisons in the same manner as demonstrated in the One-Way ANOVA with Comparisons tutorial."<br /><br />This statement was for me a bit misleading. Pairwise test presented in the Comparison tutorial is not doing _paired_ t-test, which would be relevant for repeated measures data. The change required in the pairwise example to work with paired data is to "paired=T" as an additional parameter:<br />pairwise.t.test(dataOneWayComparisons$StressReduction, dataOneWayComparisons$Treatment, p.adj = "none", "paired=T")Sakari Jimenezhttp://mielipiteet.finoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-39339762120103050842011-04-08T07:54:54.899-07:002011-04-08T07:54:54.899-07:00Thanks. I do comment every line of code in the tex...Thanks. I do comment every line of code in the text files to give an idea of what is happening, but if you want the technical documentation for each function, you can use the materials listed under Documentation at http://www.r-project.org/. Usually, if you search Google for a particular R function, you will find its formal documentation early in the results.John M. Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-33655606184140798312011-04-08T04:22:54.539-07:002011-04-08T04:22:54.539-07:00Your tutorial series are very helpful! I've tr...Your tutorial series are very helpful! I've tried using One-Way Repeated Measures ANOVA on a data set and it worked. I've also referred to the complete example right at the end of this topic. Do you know where I can get the full explanation for the R-code?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-21111106540719375342011-04-07T08:07:59.317-07:002011-04-07T08:07:59.317-07:00Hi. Your sample size is pretty small compared to t...Hi. Your sample size is pretty small compared to the number of measurements you are taking, which may be what is causing the error. If you see the post immediately preceding your original question, there is an alternative function provided for conducting the analysis. For help with general statistics or your homework, I recommend consulting your instructor and fellow students.John M. Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-2845402310023229762011-04-07T03:04:13.580-07:002011-04-07T03:04:13.580-07:00Hi, first of all, I'm not really sure if I sho...Hi, first of all, I'm not really sure if I should use One-Way Repeated Measures or Two-Way Repeated Measures. Basically, I'm interested in studying the effect of caffeine on sleep patterns/hours of sleep among students. My sample consists of 10 students. I would randomly divide them into 2 groups: <br />Group1: One has their sleep times recorded after taking caffeinated drink<br />Group2: One has their sleep times recorded after taking non-caffeinated drink.<br />Then they are asked to keep a daily,1-week diary of their sleep times. It means each student will have their sleep times recorded on a daily basis(Day1, Day2, etc) for one week. This assignment requires me to use RAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-42438486220757371862011-04-06T18:03:42.916-07:002011-04-06T18:03:42.916-07:00Hi, I don't have enough details about your pro...Hi, I don't have enough details about your problem to help specifically, but the preceding comments on this post cover the extent of errors and potential solutions that we have come across to date.John M. Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-25359882640233213622011-04-06T13:49:25.484-07:002011-04-06T13:49:25.484-07:00I'm currently using R for my statistics projec...I'm currently using R for my statistics project, I received an error message when I tried to insert the Anova(mod, idata, idesign) function. Is there any similar command that I can use in R? My project requires me to compute one-way repeated measures ANOVA and randomization/permutation test.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-62280406510000921102011-03-01T07:52:58.349-07:002011-03-01T07:52:58.349-07:00Thanks for the comments. I am familiar with this e...Thanks for the comments. I am familiar with this error. In short, it has to do with a combination of a lack of degrees of freedom to execute the multivariate tests (i.e. small sample size compared to variables) and the inability of the Anova() function to ignore/forgo calculating the multivariate tests. See this R listserv discussion for details: http://r.789695.n4.nabble.com/Anova-in-car-SSPE-apparently-deficient-rank-tp997619p997619.html.<br /><br />An alternative, which will get you the Greenhouse-Geisser and Hyunh-Feldt epsilon corrections, but no multivariate tests, is to use the anova() function.<br /><br />anova(ageModel, idata = ageFrame, X = ~ageFactor, test = "Spherical")<br /><br />One caveat, I believe, is that this will use Type I SS, whereas my Anova() example uses Type III SS. I'm not sure how to get Type III SS with the anova() function.John M. Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-25433203718078293312011-03-01T01:08:10.570-07:002011-03-01T01:08:10.570-07:00Your tutorial is excellent. I was able to follow ...Your tutorial is excellent. I was able to follow it easily and quickly analyze a data set I've been working with for a long time. I tried applying the same steps to another data set but when I tried to use the Anova(mod, idata, idesign) function I got the following error message:<br /><br />Error in linearHypothesis.mlm(mod, hyp.matrix, SSPE = SSPE, idata = idata, : <br /> The error SSP matrix is apparently of deficient rank = 3 < 4<br /><br />Do you have any idea what this means or how to deal with it. Thanks a lot!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-87048063966521172192011-02-17T22:08:14.482-07:002011-02-17T22:08:14.482-07:00Thanks for your comments and I am glad to help. It...Thanks for your comments and I am glad to help. It sounds like you might be interested in the Two-Way ANOVA with Interactions tutorial (available from the Topics menu under the ANOVA heading), which demonstrates the investigation of simple main effects subsequent to identifying an interaction between the main effects.<br /><br />I appreciate the topic suggestions. I tend to refrain from covering statistical methods/issues themselves, since I am not formally trained as a statistician. Instead, I focus on applications using R. I'm also limited to writing about the techniques that I have learned and practiced, though I do welcome guest posts.John M. Quickhttps://www.blogger.com/profile/05331039307550313006noreply@blogger.comtag:blogger.com,1999:blog-6710487119650146215.post-31912617040136832922011-02-17T14:36:40.735-07:002011-02-17T14:36:40.735-07:00Thank you for doing this tutorial series. I apprec...Thank you for doing this tutorial series. I appreciate the time and effort you have spent on this project. <br /><br />I know that you have covered 2 way ANOVA. However, would you consider doing a tutorial on factorial ANOVA (possibly as a bridge to Design of Experiments)? That in itself is a big topic, but it would also be helpful to see how to handle center points (and possibly lack of fit).<br /><br /><br />I encourage you to add to the series, whatever the topics. The practical and concise mannerin which you provide the information is very helpful.Anonymousnoreply@blogger.com