Skip to content

Factor variables not displaying in LM model results correctly when reference level is changed #1

@drcanak

Description

@drcanak

Thank you for the package. Packages creating publication ready tables are always welcome. I found that, at least for plain linear models, specifying new contrasts does not produce the final table as I expected. See the following for an example of what happens:

`library(autoReg)
data("mtcars")
fit=lm(mpg ~ cyl,
data=mtcars)
autoReg(fit,final=TRUE)

mtcars$cyl.f <- factor(mtcars$cyl)
fit = lm(mpg ~ cyl.f,
data=mtcars)
autoReg(fit,final=TRUE)

contrasts(mtcars$cyl.f) <- contr.treatment(3, base = 3)
fit = lm(mpg ~ cyl.f,
data=mtcars)
autoReg(fit,final=TRUE)`

Admittedly, I do not know how to read R code well enough to look at the underlying functions to know what is going on, or how it might be fixed.

Thanks again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions