est_p_ci | R Documentation |
Display estimate, confidence interval and p-value for one model term
est_p_ci(model, term, mult = 1, digits = 2, ...)
model |
model object |
term |
model term |
mult |
scale (multiply) the parameter by this factor |
digits |
number of significant digits to display |
... |
optional arguments |
set.seed(42)
# fit an example model with 3 groups
y <- rnorm(100)
x <- cut(rnorm(100, mean=y, sd=0.25),c(-4,-1.5,0,1.5,4))
reg <- lm(y ~ x)
reg
# show model estimate, p-value, and confidence interval
# for the first group
est_p_ci(reg, 2)
# estimate some group contrasts
cmat <- rbind( "1 vs 4" =c(-1, 0, 0, 1),
"1+2 vs 3+4"=c(-1/2,-1/2, 1/2, 1/2),
"1 vs 2+3+4"=c(-3/3, 1/3, 1/3, 1/3))
cont <- fit.contrast(reg, x, cmat, conf.int = 0.95)
cont
# show the contrast estimate, p-value, and confidence interval
# for the first contrast
est_p_ci(cont, 2:3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.