[R] regression coefficients

Cristiano Alessandro cri.alessandro at gmail.com
Thu Feb 18 02:54:19 CET 2016


Dear all,

I am trying to visualize the regression coefficients of the linear model 
that the function aov() implicitly fits. Unfortunately the function 
summary.lm() throws an error I do not understand. Here is a toy example:

dv <- c(1,3,4,2,2,3,2,5,6,3,4,4,3,5,6);
subject <- 
factor(c("s1","s1","s1","s2","s2","s2","s3","s3","s3","s4","s4","s4","s5","s5","s5"));
myfactor_c <- 
factor(c("f1","f2","f3","f1","f2","f3","f1","f2","f3","f1","f2","f3","f1","f2","f3")) 

mydata_c <- data.frame(dv, subject, myfactor)

mod_c <- aov(dv ~ myfactor_c + Error(subject/myfactor_c), data=mydata_c)

 > summary.lm(mod_c)
Error in if (p == 0) { : argument is of length zero

Please note that the example is a within-subject design with factor 
myfactor_c.

Any help is greatly appreciated.

Best
Cristiano

PS. If this is a stupid question, I apologize. I am very new to R.



More information about the R-help mailing list