ANOVA: Perform Analysis of Variance for a linear model

Description Usage Arguments Value Author(s) Examples

View source: R/ANOVA.R

Description

Function performs analysis of variance using sequential sums of squares for a linear model formula, as provided.

Usage

1
ANOVA(f, data = NULL, iter = 999, seed = NULL)

Arguments

f

A formula in the form y ~ x. The left-hand side of the formula, y, is the variable one wishes to analyze. The right-hand side, x, is a variable to describe the different samples (a factor). It is important that the formula is set up this way. Do not provide two different vectors!

data

The data frame from which the variables can be found.

iter

Number of resampling iterations. The oberved value counts as one iteration, so this number should be the desired number of permutations - 1. For example, if 1,000 permutations are desired, this value should be 999.

seed

If one should wish to define the random seed for the random permutations (for advanced users).

Value

The function returns a list containg an ANOVA table, SS, df, coefficients of determination, F values, and other goodies for advanced users.

Author(s)

Michael Collyer

Examples

1
2
3
4
5
6
7
data(cad)
cad$center <- as.factor(cad$center) # change numeric variable to factor

ANOVA1 <- ANOVA(age ~ center, data = cad, iter = 999)
summary(ANOVA1)
plot(ANOVA1, method = "hist")
plot(ANOVA1, method = "diagnostic")

mlcollyer/chatham.bio532 documentation built on May 23, 2019, 2:08 a.m.