| ancova {jmv} | R Documentation |
Analysis of Covariance
ancova(data, dep, factors = NULL, covs = NULL, modelTerms = NULL,
ss = "3", effectSize = NULL, contrasts = NULL, plotHAxis = NULL,
plotSepLines = NULL, plotSepPlots = NULL, postHoc = NULL,
postHocCorr = list("tukey"), descStats = FALSE, homo = FALSE,
qq = FALSE, plotError = "ci", ciWidth = 95)
data |
the data as a data frame |
dep |
a string naming the dependent variable from |
factors |
a vector of strings naming the fixed factors from
|
covs |
a vector of strings naming the covariates from |
modelTerms |
a list of character vectors describing the terms to go into the model |
ss |
|
effectSize |
one or more of |
contrasts |
a list of lists specifying the factor and type of contrast
to use, one of |
plotHAxis |
a string naming the variable placed on the horizontal axis of the plot |
plotSepLines |
a string naming the variable represented as separate lines on the plot |
plotSepPlots |
a string naming the variable to separate over to form multiple plots |
postHoc |
a list of terms to perform post-hoc tests on |
postHocCorr |
one or more of |
descStats |
|
homo |
|
qq |
|
plotError |
|
ciWidth |
a number between 50 and 99.9 (default: 95) specifying the confidence interval width |
A results object containing:
results$main | a table of ANCOVA results | ||||
results$model | The underlying aov object |
||||
results$assump$homo | a table of homogeneity tests | ||||
results$assump$qq | a q-q plot | ||||
results$contrasts | an array of contrasts tables | ||||
results$postHoc | an array of post-hoc tables | ||||
results$desc | a table of descriptives | ||||
results$descPlot | a descriptives plot | ||||
results$descPlots | an array of descriptives plots | ||||
Tables can be converted to data frames with asDF or as.data.frame. For example:
results$main$asDF
as.data.frame(results$main)
data('ToothGrowth')
ancova(ToothGrowth, dep = 'len', factors = 'supp', covs = 'dose')
#
# ANCOVA
#
# ANCOVA
# -----------------------------------------------------------------------
# Sum of Squares df Mean Square F p
# -----------------------------------------------------------------------
# supp 205 1 205.4 11.4 0.001
# dose 2224 1 2224.3 124.0 < .001
# Residuals 1023 57 17.9
# -----------------------------------------------------------------------
#