[R] Error while calculating AOV

apsawant apsawant at yahoo.com
Tue Nov 13 18:16:30 CET 2007


Hi ,

I am new to R.
I am trying to run a simple example script to calculate AOV.
Below is the script file (aov.R) I am trying to execute:
aov.R
------
data1<-c(49,47,46,47,48,47,41,46,43,47,46,45,48,46,47,45,49,44,44,45,42,45,45,40
,49,46,47,45,49,45,41,43,44,46,45,40,45,43,44,45,48,46,40,45,40,45,47,40)

matrix(data1, ncol= 4, dimnames = list(paste("subj", 1:12),
c("Shape1.Color1",
"Shape2.Color1", "Shape1.Color2", "Shape2.Color2")))

Hays.df<-data.frame(rt = data1,
subj=factor(rep(paste("subj", 1:12, sep=""), 4)),
shape=factor(rep(rep(c("shape1","shape2"), c(12, 12)), 2)),
color=factor(rep(c("color1","color2"), c(24, 24))))

aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df)

summary(aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df))


Here is the error I get:
> source("aov.R")
Error in terms(formula, "Error", data = data) : 
        Object "shape" not found

I would appreciate your help as to why I am getting this error message.

Thanks,
Amit.
-- 
View this message in context: http://www.nabble.com/Error-while-calculating-AOV-tf4799288.html#a13730481
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list