Learn R Programming

sasLM (version 0.5.0)

cSS: Sum of Square with a Given Contrast Set

Description

Calculates sum of squares of a contrast from a lfit result.

Usage

cSS(K, rx, eps=1e-8)

Arguments

K

contrast matrix. Each row is a contrast.

rx

a result of lfit function

eps

Less than this value is considered as zero.

Value

Returns sum of square and its F value and p-value.

Df

degree of freedom

Sum Sq

sum of square for the set of contrasts

Mean Sq

mean square

F value

F value for the F distribution

Pr(>F)

proability of larger than F value

Details

It calculates sum of squares with given a contrast matrix and a lfit result. It corresponds to SAS PROC GLM CONTRAST.

Examples

Run this code
# NOT RUN {
  x = ModelMatrix(uptake ~ Type, CO2)
  y = model.frame(uptake ~ Type, CO2)[,1]
  rx = lfit(x, y)
  cSS(t(c(0, -1, 1)), rx) # sum of square 
  ANOVA(uptake ~ Type, CO2) # compare with the above
# }

Run the code above in your browser using DataLab