Computes confidence intervals for the pairwise differences between levels
of a factor, based off of stats::TukeyHSD
.
factorComp(fit, factor)
# S3 method for inzfactorcomp
print(x, ...)
a lm/glm/svyglm object
the name of the factor to compare
an inzfactorcomp
object
extra arguments for print (ignored)
a factor level comparison object with estimates, CIs, and (adjusted) p-values
print(inzfactorcomp)
: print method for object of class inzfactorcomp
f <- lm(Sepal.Length ~ Sepal.Width + Species, data = iris)
factorComp(f, "Species")
#> # Estimated differences in mean Sepal.Length between levels of Species
#> adjusted for the other variables in the model
#> (col group - row group)
#>
#> Estimates
#>
#> versicolor virginica
#> setosa 1.458743 1.9468166
#> versicolor 0.4880736
#>
#> 95% Confidence Intervals
#>
#> versicolor virginica
#> setosa 1.193884 1.7105279
#> 1.723602 2.1831054
#> versicolor 0.2748841
#> 0.7012630
#>
#> P-values
#>
#> versicolor virginica
#> setosa < 1e-08 < 1e-08
#> versicolor 7.0812e-07