Get p-value for group mean difference without refitting linear model with a new reference level

后端 未结 3 1815
名媛妹妹
名媛妹妹 2021-01-25 06:42

When we have a linear model with a factor variable X (with levels A, B, and C)

y ~ factor(X) + Var2 + Var3 
<         


        
3条回答
  •  难免孤独
    2021-01-25 07:17

    You could use the library car, and use the function linearHypothesis with the parameter vcov.

    Set this as the variance-covariance matrix of your model.

    The function takes formulas or a matrix to describe the system of equations that you would like to test.

提交回复
热议问题