I use my data with a discrete counter, using various functions for comparison. I am mapping a GEE model using the geepack linear mixed effect model on log(count) using lme ( nlme ), GLMM using glmer ( lme4 ) and GAMM using gamm4 ( gamm4 ) in R.
I am interested in comparing these models and would like to build the expected (predicted) values ββfor the new data set (predictor variables). My goal is to compare the predicted effects for each model under specific conditions (x variables). Of particular interest is the comparison of marginal (GEE) and conditional ratings.
I think that my main problem may be getting new data in the correct form with the correct labels and attributes, etc. I am still very new to R and struggling with this stuff (without a course for this at my university, unfortunately).
I currently have models installed
gee1 lme1 lmer1 gamm1
and can easily extract its fixed effect coefficients and standard errors. I also have no problem converting them from a log scale or estimating confidence intervals that take into account random effects.
I also have my new dataframe newdat , which has 365 observations of 23 variables (average environmental data for each day of the year).
I focused on how to predict new score estimates from this. I played with the model.matrix function, but could not get it to work. For example, I tried:
mm = model.matrix(terms(glmm1), newdat)
Any suggestions or good links are welcome. Can someone help with the error above?
source share