How to extract coefficients' standard error from an “aov” model

后端 未结 1 1236
猫巷女王i
猫巷女王i 2020-12-18 09:52

I did a aov model and I just want to extract the standard errors of each coefficient.

model <- aov(Molecule ~  Comorbidity + Age + BMI + Sex,         


        
相关标签:
1条回答
  • 2020-12-18 10:25

    Use lm method for summary:

    coef(summary.lm(model))
    

    This will give a coefficient table / matrix of 4 columns (mean, standard error, t-value, p-value) for all identifiable coefficients. Then you can extract the 2nd column for standard error.

    aov returns object of primary class "aov" but secondary class "lm", hence both summary.aov and summary.lm apply but gives different things. When you simply do summary(model), the former is called as the result of S3 method dispatching.

    0 讨论(0)
提交回复
热议问题