Learn R Programming

sasLM (version 1.0.1)

aov2: ANOVA with Type II SS

Description

ANOVA with Type II SS.

Usage

aov2(Formula, Data, BETA=FALSE, Resid=FALSE)

Value

The result table is comparable to that of SAS PROC ANOVA.

Df

degrees of freedom

Sum Sq

sum of squares for the set of contrasts

Mean Sq

mean square

F value

F value for the F distribution

Pr(>F)

probability of a larger F value

The next returns are optional.

Parameter

Parameter table with standard error, t value, p value. TRUE is 1, and FALSE is 0 in the Estimable column. This is returned only with the BETA=TRUE option.

Fitted

Fitted values or y hat. This is returned only with the Resid=TRUE option.

Residual

Weighted residuals. This is returned only with the Resid=TRUE option.

Arguments

Formula

a conventional formula for a linear model.

Data

a data.frame to be analyzed

BETA

if TRUE, coefficients (parameters) of REG will be returned. This is equivalent to the SOLUTION option of SAS PROC GLM.

Resid

if TRUE, fitted values (y hat) and residuals will be returned

Author

Kyun-Seop Bae k@acr.kr

Details

It performs the core function of SAS PROC GLM, and returns Type II SS. This also accepts continuous independent variables.

Examples

Run this code
  aov2(uptake ~ Plant + Type + Treatment + conc, CO2)
  aov2(uptake ~ Plant + Type + Treatment + conc, CO2, BETA=TRUE)
  aov2(uptake ~ Plant + Type + Treatment + conc, CO2, Resid=TRUE)
  aov2(uptake ~ Plant + Type + Treatment + conc, CO2, BETA=TRUE, Resid=TRUE)
  aov2(uptake ~ Type, CO2)
  aov2(uptake ~ Type - 1, CO2)

Run the code above in your browser using DataLab