# Linear mixed model subject level

#### isingini

##### New Member
Dear All
I am new to R and I am implementing a linear mixed model for a variance shift outlier model. I am wondering if someone in the group can help with getting subject level parameter estimates.
my model is as follows
mFit<- lmer (y ~time+trt+(1|subject), data=dataFrame)

I would like to extract estimates at the subject level as opposed to the observation level, i.e. I need estimates grouped by the subject

Thanks
Isaac

#### consuli

##### Member
Thats an easy one. You use
Code:
predict(mFit)
and assign the vector of predictions to a new variable in the dataset, eg.
Code:
dataFrame$pred= predict(mFit) # or maybe (coding blind here) dataFrame$pred= predict(mFit)\$value
and then you use
Code:
aggregate()
to compute the conditional predictions.

Consuli