How to get coefficients and their confidence intervals in mixed effects models?

前端 未结 6 946
無奈伤痛
無奈伤痛 2020-12-04 10:52

In lm and glm models, I use functions coef and confint to achieve the goal:

m = lm(resp ~ 0 + var1 + var1         


        
6条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 11:27

    To find the coefficient, you can simply use the summary function of lme4

    m = lm(resp ~ 0 + var1 + var1:var2) # var1 categorical, var2 continuous
    m_summary <- summary(m)
    

    to have all coefficients :

    m_summary$coefficient
    

    If you want the confidence interval, multiply the standart error by 1.96:

    CI <- m_summary$coefficient[,"Std. Error"]*1.96
    print(CI)
    

提交回复
热议问题