Hi,

I have posted this on R-help, but I have not got more information so far.
Bbolker<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=23641>suggests
that I should re-post it here, and see if I can get further help.

The data set that I have is a cluster data, and I want to run a HLM mixed
model with multi-level response. Here is my data set:
response:
   - Level (num:  1, 2, 3, 4, 5 - 5 levels)
Covariates:
   - Type (Factor: A, B, C - 3 levels)
   - yr (num: 2006, 2007, ...)
   - Male (num: 0=not Male, 1=Male - 2 levels)
   - Ethnicity (Factor: A, B, H, ..., - 7 levels)
   - ELL (num: 0, 1, - 2 levels)
   - Disability (num: 0, 1, - 2levels)
   - avgTransfers (num with missing values)
   - sdTransfers (num with missing values)
   - agec (num with missing values)
   - PctELL (num)
   - PctDisability (num)
   - PctMale (num)
Random Effects:
   - Schoolid, Teacherid, Studentid

library(MCMCglmm)
y <- MCMCglmm(factor(Level) ~ Type+factor(yr>=2006)+Male+Ethnicity+ELL+

avgTransfers+sdTransfers+agec+Disability+ELL*pctELL+Disability*pctDisability+

          pctMale+factor(yr>=2008)*factor(Grade),
random=~Schoolid+Teacherid+Studentid,
          family="categorical", data=data[data$Grade>=4,])

*Error in MCMCglmm(FCATprofLevel ~ transferTypeCat + factor(yr >= 2008) +  :

please use idh(trait):units, us(trait):units or trait:units for error
structures involving catgeorical data with more than 2 categories*

I also read chapter 5 of the course notes vignette, and I tried codes below:

library(MCMCglmm)
y <- MCMCglmm(factor(Level) ~ Type+factor(yr>=2006)+Male+Ethnicity+ELL+

avgTransfers+sdTransfers+agec+Disability+ELL*pctELL+Disability*pctDisability+

          pctMale+factor(yr>=2008)*factor(Grade), rcov=~us(trait):units,
random=~Schoolid+Teacherid+Studentid,
          family="categorical", data=data[data$Grade>=4,], verbose=FALSE)

*Error in buildZ(rmodel.terms[r], data = data) : missing values in random
predictors*

Does anyone know how to fix it, or if there are any other methods that can
run this model?

Thanks a lot!
-- 
Best regards,
Ping

	[[alternative HTML version deleted]]


