[R-sig-ME] Mixed cumulative link modelling - error message
Petri Lankoski
petri.lankoski at gmail.com
Fri Aug 21 19:47:08 CEST 2015
Hi,
You need to force rating from int to factor. Try:
bob$rating = factor(bob$rating)
On 21/08/15 18:36, Georgina Southon wrote:
> Hi,
>
> I hope someone can help. I have problems fitting a cumulative link mixed model to my data.
> Looking at the str output, rating shows as an integer, despite the fact that it shows as an ordered factor when asked is.factor. Is this the problem or is there something else I have overlooked?
>
> str(bob)
> 'data.frame': 283 obs. of 4 variables:
> $ site : Factor w/ 10 levels "ADD","BH","BR",..: 4 4 4 4 4 4 4 4 4 4 ...
> $ person : Factor w/ 283 levels "ADD10","ADD11",..: 80 91 102 104 105 106 107 108 109 81 ...
> $ treatment: Factor w/ 2 levels "CONTROL","MEADOW": 2 2 2 2 2 2 2 2 2 2 ...
> $ rating : int 4 3 4 2 3 4 5 5 5 3 ...
>>
>> m1<-clmm2(rating~treatment,random=person,data=bob)
>
> Error in clm2(location = rating ~ treatment, data = bob, subset = c("1", :
> response needs to be a factor
>
> Thanks for any feedback / advice!
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
--
Petri Lankoski ................... Associate Professor
Media Technology ................ Södertörn University
email: petri.lankoski at sh.se .........................
Web: http://www.iki.fi/petri.lankoski/ ...............
More information about the R-sig-mixed-models
mailing list