Last data update: 2014.03.03

R: Computes ANOVA table given data and design
anovatableR Documentation

Computes ANOVA table given data and design

Description

Given data and a matrix describing a design for a linear model, the function creates an ANOVA table, using sums of squares based on a subdivision of the columns of the design matrix given as the third argument for the function.

Usage

anovatable(data, design, subdivisions = c(1, dim(design)[2] - 1))

Arguments

data

A vector with data values

design

A matrix with the same number of rows as there are data values. The matrix represents the design matrix for the linear model the ANOVA table is based on.

subdivisions

A vector of integers summing to the number of columns in the design matrix. The number of rows of the ANOVA table will be equal to the length of this vector.

Value

An ANOVA table.

Author(s)

Petter Mostad <mostad@chalmers.se>

Examples

data1 <- simulate(normal(2.7, log(0.7)), 3)
data2 <- simulate(normal(4.0, log(0.7)), 5)
data3 <- simulate(normal(3.2, log(0.7)), 3)
data4 <- simulate(normal(4.1, log(0.7)), 4)
anovatable(c(data1, data2, data3, data4), designManyGroups(c(3,5,3,4)))

Results