Description Usage Arguments Details Value Author(s) See Also Examples
This function is meant as a userfriendly wrapper to approximate the way analysis of variance is done in SPSS.
1 2 3 4 5 6 7 8 |
data |
The dataset containing the variables to analyse. |
y |
The dependent variable. For oneway anova, factorial anova, or ancova, this is the name of a variable in dataframe |
between |
A vector with the variables name(s) of the between subjects factor(s). |
covar |
A vector with the variables name(s) of the covariate(s). |
plot |
Whether to produce a plot. Note that a plot is only produced for oneway and twoway anova and oneway repeated measures designs: if covariates or more than two between-subjects factors are specified, not plot is produced. For twoway anova designs, the second predictor is plotted as moderator (and the first predictor is plotted on the x axis). |
levene |
Whether to show Levene's test for equality of variances (using |
digits |
Number of digits (actually: decimals) to use when printing results. The p-value is printed with one extra digit. |
contrast |
This functionality has not been implemented yet. |
This wrapper uses oneway
and lm
and lmer
in combination with car
's Anova
function to conduct the analysis of variance.
Mainly, this function prints its results, but it also returns them in an object containing three lists:
input |
The arguments specified when calling the function |
intermediate |
Intermediat objects and values |
output |
The results such as the plot. |
Gjalt-Jorn Peters
Maintainer: Gjalt-Jorn Peters <gjalt-jorn@userfriendlyscience.com>
regr
and logRegr
for similar functions for linear and logistic regression and oneway
, lm
, lmer
and Anova
for the functions used behind the scenes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ### Oneway anova with a plot
fanova(dat=mtcars, y='mpg', between='cyl', plot=TRUE);
### Factorial anova
fanova(dat=mtcars, y='mpg', between=c('vs', 'am'), plot=TRUE);
### Ancova
fanova(dat=mtcars, y='mpg', between=c('vs', 'am'), covar='hp');
### Repeated measures anova; first generate datafile
dat <- mtcars[, c('am', 'drat', 'wt')];
names(dat) <- c('factor', 't0_dependentVar' ,'t1_dependentVar');
dat$factor <- factor(dat$factor);
### Then do the repeated measures anova
fanova(dat, y=c('t0_dependentVar' ,'t1_dependentVar'),
between='factor', plot=TRUE);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.