m-clark / mixedup

An R package for extracting results from mixed models that are easy to use and viable for presentation.
http://m-clark.github.io/mixedup
MIT License
64 stars 2 forks source link

extract_random_effect did not yield confidence intervals for nlme object #9

Closed tapirus07 closed 4 years ago

tapirus07 commented 4 years ago

mixedup::extract_random_efects does not report condfidence intervals for nlme object. It is not working for nonlinear models even though the documentation inform that fucntion can handle with this objects.

mod=nlme(y~Asym/exp((xmid-x)/scal), data=data, fixed = Asym+xmid+scal ~ 1, random = Asym+xmid+scal~1|country, )

extract_random_effect(mod) group_var effect group value

1 country Asym Afghanistan -13353. 2 country Asym Algeria -11859. 3 country Asym Andorra -5100. 4 country Asym Argentina 337. 5 country Asym Armenia -4778. 6 country Asym Australia -7036. 7 country Asym Austria 1543. 8 country Asym Azerbaijan -11756. 9 country Asym Bahrain -13132. 10 country Asym Belarus -12661. # ... with 275 more rows Any alternative or solution?
m-clark commented 4 years ago

There are no intervals for random effects for nlme, because it doesn't provide even a standard error to calculate them with. In the helpfile for extract_random_effects it states "The nlme package only provides the estimated random effect parameters, not their uncertainty, so it isn't provided."

The brms package may be able to do this type of model for you, at which point you should be able to get the interval estimate from extract_random_effects.

m-clark commented 4 years ago

Going ahead and closing as the function is working as documented, but feel free to post if something else is amiss.