
Last chance! 50% off unlimited learning
Sale ends in
compIntercepts(mdl, common.cov = mean(x), conf.level = 0.95,
digits = getOption("digits"), ...)
## S3 method for class 'compIntercepts':
print(x, ...)
lm
object.compIntercepts
object (i.e., returned from compIntercepts
).TukeyHSD
or print
functions.comparison
The comparison results as returned from TukeyHSD
.
common.cov
The value of the common covariate sent in common.cov
.
adjvals
A vector of values of the repsonse variable adjusted to the common.cov
value of the covariate. This vector can be appended to the original data frame to construct summary statistics for the adjusted values (e.g., mean adjusted value for each group).
means
A vector of mean adjusted values at the value of the common covariate.
digits
The value sent in digits
.
rnm
The name of the response (LHS) variable.
cnm
The name of the covariate variable.
}
The print
function prints the comparison and adjusted means in a nice format.TukeyHSD
function is inappropriate for testing for difference in intercepts in a dummy variable regression.
This function provides a statistical comparison of all pairs of intercepts by first adjusting the observed data to a common value of the covariate (common.cov
), computing a one-way ANOVA to determine if the mean adjusted values differ by level of the group factor in the original dummy variable regression, and then submitting the one-way ANOVA results to the TukeyHSD
function to determine for which levels the mean adjusted values differ. The levels for which the mean adjusted values differ are also the levels for which the intercepts differ.
The default is to compute the adjusted values at the mean value of the covariate (i.e., common.cov=mean(x)
. However, if interest is in the intercepts (i.e., at X=0) then common.cov=0
should be used instead.TukeyHSD
and compSlopes
from ## Reduct Mirex data to years where slopes don't differ to
## illustrate this function ... see compSlopes() for
## analysis of full data set.
data(Mirex)
Mirex <- Mirex[Mirex$year!="1996" & Mirex$year!="1999",]
Mirex$year <- factor(Mirex$year)
## Fit DVR, see that slopes don't differ,
## compare intercepts, visualize results
lm1 <- lm(mirex~weight*year,data=Mirex)
anova(lm1)
compIntercepts(lm1)
## Fit model without interaction to avoid warning, but
## note that the compIntercepts() results are the same
lm2 <- lm(mirex~weight+year,data=Mirex)
compIntercepts(lm2)
fitPlot(lm1,legend="topleft")
Run the code above in your browser using DataLab