I'm trying to run an ANOVA in R and I have a problem: I used this command: anova(lm(time~age*region*facility)) Age, region, and facility are all factor levels, which has 2, 4, and 3 levels respectively.
however, in the output (anova table), it states that the df is 1 for all three factors, which should be 1, 3, and 2 respectively. Can anyone tell me if it is necessary to declare the factors as class before it can run correctly? Or is there any other problem? I attached the data set as shown below. Thank you very much! ( http://r.789695.n4.nabble.com/file/n3089686/data1.csv data1.csv -- View this message in context: http://r.789695.n4.nabble.com/help-with-anova-tp3089686p3089686.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.