Adding covariates to nlme model in R

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 14:21:21

问题


I've recently started learning to fit data using the nlme model. I was wondering if there was a more logical way of generating all possible combinations of covariates (for the variables asy and int) in the nlme model below:

fmzeta.nlme <- nlme(
               z ~ asy - (asy - int)*exp(-c*t), 
               fixed = list(asy ~ age + wfa + vl,
                            int ~ age + wfa + vl, c ~ 1),
               random = int + asy ~ 1,
               start = c(-1, 0, -2, 0, 0, 0, 0, 0, 0.03),
               data = DATA)

As you can see there are three covariates for the two variables asy and int. I would like to generate all possible combinations of covariates and then look for the model that has the best fit. I haven't found any topic related to this so far so I would appreciate any helpful ideas. Could someone also tell me how to make the r code appear properly in a post?

Thanks

来源:https://stackoverflow.com/questions/20520965/adding-covariates-to-nlme-model-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!