CoeffDiffCI | R Documentation |
Calculate the confidence interval for the difference of two coefficients in a linear model.
CoeffDiffCI(x, coeff, conf.level = 0.95, sides = c("two.sided", "left", "right"))
x |
the linear model object |
coeff |
a vector of length two, containing either the names or the index of the two coefficients whose difference should be used |
conf.level |
confidence level of the interval. |
sides |
a character string specifying the side of the confidence interval, must be one of |
This is quite useful in the course of the modelling process.
a numeric vector with 3 elements:
mean |
mean |
lwr.ci |
lower bound of the confidence interval |
upr.ci |
upper bound of the confidence interval |
Andri Signorell <andri@signorell.net>
linearHypothesis()
# get some model first...
r.lm <- FitMod(Fertility ~ ., data=swiss, fitfn="lm")
# calculate the confidence interval for the difference of the
# coefficients Examination and Education
CoeffDiffCI(r.lm, c("Examination", "Education"))
# the test could be calculated as
car::linearHypothesis(r.lm, "Education = Examination")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.