Skip to content
Prev 169614 / 398513 Next

lme() direction

Mike Lawrence <mike <at> thatmike.com> writes:

Thanks for the excellent reproducible sample set!
Without word, it would be

summary(lme(rt~type*color, data=a,random=~1|id))

With the interaction, the extreme would be 
summary(lme(rt~type*color*word, data=a,random=~1|id))

or, less extreme

summary(lme(rt~type*color+color:word, data=a,random=~1|id))

but all these fail because of the rather degenerate structure 
of you data set. While lmer in package lme4 allows for a wider
set of solutions, I currently do not see how it could help,
but I might be wrong with p=0.5.


               word happy joy sad grumpy
type     color                          
positive white         93  90   0      0
         red           90  88   0      0
         green         88  87   0      0
negative white          0   0  88     95
         red            0   0  91     85
         green          0   0  88     88
That's one of the points where you have little to bother with the lme
approach. Collapsing would give equal weights to unequal numbers of
repeat, and might of minor importance when not too extreme, though.

Dieter


set.seed(1)
a=rbind(
	cbind(
		type='positive'
		,expand.grid(
			id=1:10
			,color=c('white','red','green')
			,word=c('happy','joy')
			,repetition = 1:10
		)
	)
	,cbind(
		type='negative'
		,expand.grid(
			id=1:10
			,color=c('white','red','green')
			,word=c('sad','grumpy')
			,repetition = 1:10
		)
	)
)

#add some fake rt data
a$rt=rnorm(length(a[,1]))

#And because people make errors sometimes:
a$error = rbinom(length(a[,1]),1,.1)

#remove error trials because they're not psychologically interesting:
a=a[a$error==0,]

library(nlme)
ftable(a[,c(1,3,4)])
summary(lme(rt~type*color, data=a,random=~1|id))