We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
estimate_contrasts()
as.factor()
estimate_contrasts(): Different results using as.factor() within or outside formula:
library(modelbased) # as.factor within model = 2 levels model <- lm(mpg ~ as.factor(cyl) + wt * hp, mtcars) estimate_contrasts(model) #> No variable was specified for contrast estimation. Selecting `contrast = "cyl"`. #> Marginal Contrasts Analysis #> #> Level1 | Level2 | Difference | 95% CI | SE | t(26) | p #> ------------------------------------------------------------------- #> cyl4 | cyl8 | 1.45 | [-2.79, 5.70] | 2.06 | 0.70 | 0.487 #> #> Marginal contrasts estimated at cyl #> p-value adjustment method: Holm (1979) # as.factor outside model = 3 levels mtcars2 <- mtcars mtcars2$cyl <- as.factor(mtcars2$cyl) model <- lm(mpg ~ cyl + wt * hp, mtcars2) estimate_contrasts(model) #> No variable was specified for contrast estimation. Selecting `contrast = "cyl"`. #> Marginal Contrasts Analysis #> #> Level1 | Level2 | Difference | 95% CI | SE | t(26) | p #> -------------------------------------------------------------------- #> cyl4 | cyl6 | 1.26 | [-2.55, 5.07] | 1.49 | 0.85 | > .999 #> cyl4 | cyl8 | 1.45 | [-3.83, 6.74] | 2.06 | 0.70 | > .999 #> cyl6 | cyl8 | 0.20 | [-3.64, 4.03] | 1.50 | 0.13 | > .999 #> #> Marginal contrasts estimated at cyl #> p-value adjustment method: Holm (1979)
Created on 2023-07-02 with reprex v2.0.2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
estimate_contrasts()
: Different results usingas.factor()
within or outside formula:Created on 2023-07-02 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: