1
$\begingroup$

I have fit a longitudinal random effects model using nlme and I prefer nlme because I can get p-values. While working with a tutor, he ran the same model in lme4 and obtained standardized coefficients and model effect size using the following codes.

The lme4 model is:

model1<-lmer(logh_production ~ growth + p_will + subsidy + trt_grp + compliance + 
nn_cent + distance + city_net_exp + county_pop_avg_per_hh + county_vcncy + 
region_id + fiscal_year + (1|city_name), mydata)

For parameter effect size (standardized beta weights):
fixef(model1) / sigma(model1)

For effect size for whole model (variation in linear mixed effects models):
1-var(residuals(model1))/(var(model.response(model.frame(model1))))

What are the equivalent codes for using nlme?

Here is my complete nlme model:

test1 <- lme(logh_production ~ logh_demand + growth + p_will + logeh_supply + trt_grp   
+ compliance + logcity_area + nn_cent + distance + city_net_exp  + loglocal_assess + 
logcity_net_rev + county_pop_avg_per_hh + region_id + fiscal_year, data=ahpRAW, 
control=list(opt="optim"), method="ML", random= ~1 | city_name)
$\endgroup$
  • $\begingroup$ Can you give us a reproducible example please? $\endgroup$ – Ben Bolker Jan 19 '15 at 14:46
  • $\begingroup$ Hi Ben, I revised the question to include examples of both the lme4 and nlme models. Just note, I'm not a stat or math person, just someone with "basic" R knowledge. $\endgroup$ – Darrel Jan 19 '15 at 18:27
  • $\begingroup$ This is not a recommended practice even for ordinary linear models. See elsewhere on the site. $\endgroup$ – Frank Harrell Jan 19 '15 at 18:47
  • $\begingroup$ Thanks for the comment Frank. What I'm trying to do is simply determine a) which is the most important variable of my statistically significant variables, and 2) how much power does my model contain. In this model, my variable of interest "compliance" is significant, but is it the most powerful variable? And more importantly, it this model useful, as only 5 variables are statistically significant? $\endgroup$ – Darrel Jan 19 '15 at 22:19
  • $\begingroup$ It would be best to have a reproducible example -- that means you illustrate your problem with a data set we can get access to somehow (either something built in to an R package, or that you post somewhere on the web or (if not too big) paste into your question -- see tinyurl.com/reproducible-000 for example ... $\endgroup$ – Ben Bolker Jan 19 '15 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.