uniANOVA: A Function to Conduct Univariate Analysis of (Co)Variance.

Description Usage Arguments Examples

Description

This function conducts a univariate analysis of (co)variance (ANOVA/ANCOVA). It includes options to print descriptives, tests and plots of model assumptions, estimated marginal means, main and simple effects tests, and APA formatted bar plots.

Usage

1
2
3
4
5
6
uniANOVA(dv = NULL, formula = NULL, factors = NULL, cov = NULL,
  data = NULL, descriptives = TRUE, assumptions = FALSE, ss = 3,
  digits = 3, emmeans = FALSE, conf = 0.95, comparisons = NULL,
  postCorr = "none", plotBar = FALSE, xLabel = NULL, yLabel = NULL,
  fillLabel = NULL, yLower = NULL, yUpper = NULL, yBreaks = NULL,
  output = "r")

Arguments

dv

Dependent variable. Defaults to NULL.

factors

Independent variables (converted to factors). All factors will be multiplied in a full-factorial design. Any factors that you do not wish to be crossed with the others should be entere using the "cov=" command. Defaults to NULL.

cov

Independent variables and/or covariates not to be crossed with other factors. These variables will also not be used for grouping in descriptive statistics. You may still utilize these factors in simple and main effects tests using the "comparisons=" command. Defaults to NULL.

data

A data frame containing the observed variables to correlate. Defaults to NULL.

descriptives

TRUE/FALSE indicating whether to display descriptive statistics for the dependent variable grouped by factors. Defaults to TRUE.

assumptions

TRUE/FALSE indicating whether you would like to print tests of model assumptions and plots of residuals.

ss

A number indicating which type sum of squares to use (i.e., 1,2,3). Defaults to 3. Uses the CAR package to conduct ANOVAs with type 3 sums of squares.

digits

Number of digits you want to round numbers too. Leave blank if you don't want to round numbers or if the Data Frame contains strings. Defaults to NULL.

emmeans

TRUE/FALSE indicating whether to display estimated marginal means grouped by factors.

conf

A number indicating the desired confidence interval. Defaults to .95.

comparisons

A list of comparisons for which you would like to conduct main or simple effects tests. Prints estimated marginal means and tests of effects (including effect size) for each comparison specified in the list. Defaults to NULL.

plotBar

TRUE/FALSE indicating whether a QQPlot bar plot should be returned for estimated marginal means across all factors, with error bars indicating confidence intervals at levels set by "conf". Defaults to FALSE.

xLabel

A string indicating the label for the x-axis in the bar plot if one is requested. Defaults to NULL, which will display variable name.

yLabel

A string indicating the label for the y-axis in the bar plot if one is requested. Defaults to NULL, which will display variable name.

fillLabel

A string indicating the label for the fill variable in the bar plot if one is requested. Defaults to NULL, which will display variable name.

yLower

A number indicating the lower limit of the y-axis in the bar plot if requested. Defaults to NULL, in which case limits are set by QQPlot.

yUpper

A number indicating the upper limit of the y-axis in the bar plot if requested. Defaults to NULL, in which case limits are set by QQPlot.

yBreaks

A number indicating the break value (i.e., interval of numbers and ticks) for the y-axis in the bar plot if requested. Defaults to NULL, in which case limits are set by QQPlot.

output

A string indicating whether results should be displayed as R output (output="r") or HTML output "output="html". Defaults to r output.

postcor

A string indicating type of correction to apply to main or simple effects tests requested using the "comparisons=" commond. Options include "none", tukey", "scheffe", "sidak", "bonferroni", "dunnettx", "mvt". Defaults to "none".

Examples

1
uniANOVA(dv = "mpg", factors = c("vs","am"), cov=c("hp"), data = mtcars, descriptives=TRUE, assumptions=TRUE, ss=3, digits=3, emmeans=TRUE, conf=.95, comparisons=c("am","vs","vs*am"), plotBar=TRUE, xLabel="Engine", yLabel="Miles per Gallon (US)", fillLabel="Transmission" yLower=10,yUpper=45,yBreaks=5,output = "html").

matthew-quesnel/simplePsych documentation built on May 17, 2019, 12:02 p.m.