0
$\begingroup$

I want to run a GLM with a factor, say car type, as one of the independent variables.

Suppose car type has the following levels: sedan, SUV, and truck. And suppose the base level is currently sedan.

Since the standard errors are dependent on the base level, is there a way to recalculate the standard errors if I decided to switch the base level before or after running the GLM in R?

From looking online I see that there's the relevel() function that can be used to change the base level to another specified level (e.g., from sedan to SUV). However, I'm looking for maybe a more general solution, since my goal is to recalculate the standard errors for the base that would be the combination of two of the levels (i.e., the base that represents the average across sedans and SUVs), assuming that the base is sedan in the GLM.

$\endgroup$

1 Answer 1

0
$\begingroup$

If you want the intercept to be the mean of the levels, then effects coding will give you an unweighted mean as your intercept. It will have a standard errors. Moreover, you can now use the standard errors produced by your beta estimates to calculate confidence intervals to see if they cross the unweighted grand mean. It can be done in R using the contrasts option in the lm command.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.