1
$\begingroup$

I'm trying to report means of levels given a model.

xy <- data.frame(y = c(rnorm(50, mean = 50, sd = 10), rnorm(50, mean = 25, sd = 10)), 
                 x = rep(c("A", "B"), each = 50))
head(xy)

library(ggplot2)
ggplot(xy, aes(x = x, y = y)) +
  theme_bw() +
  geom_jitter()

summary(glm(y ~ x, data = xy))

enter image description here

Call:
glm(formula = y ~ x, data = xy)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-22.4718   -5.0153   -0.5095    5.3976   27.2932  

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   49.441      1.259   39.26   <2e-16 ***
xB           -24.703      1.781  -13.87   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for gaussian family taken to be 79.31416)

    Null deviance: 23028.7  on 99  degrees of freedom
Residual deviance:  7772.8  on 98  degrees of freedom
AIC: 725.11

Number of Fisher Scoring iterations: 2

For level A, coefficient (intercept is) 49.441 with standard error 1.259. Easy peasy. For level B, estimate is 24.738. But what is the standard error for this? Am I overthinking this and is error 1.781 or do I need to i.e. sum standard errors?

This question was spurred by a result from lmer.

Fixed effects:
            Estimate Std. Error t value
(Intercept)  13.1294     0.7210  18.210
eyeOD         0.5759     0.2168   2.656
sexM         -0.8844     1.0081  -0.877

and I'm curious if I can report coefficients as 13.1294 and 13.7053 with standard errors of 0.7210 and 0.2168, respectively.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.