Learn R Programming

sasLM (version 1.0.1)

cSS: Sum of Square with a Given Contrast Set

Description

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

Usage

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

Value

Returns the sum of squares and its F value and p-value.

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

Arguments

K

contrast matrix. Each row is a contrast.

rx

a result of the lfit function

mu

a vector of mu for the hypothesis K. The length should be equal to the row count of K.

eps

Values less than this are considered zero.

Author

Kyun-Seop Bae k@acr.kr

Details

It calculates the sum of squares with a given contrast matrix and an lfit result. It corresponds to SAS PROC GLM CONTRAST. This can test the hypothesis that the linear combination (function)'s mean vector is mu.

See Also

CONTR

Examples

Run this code
  rx = REG(uptake ~ Type, CO2, summarize=FALSE)
  cSS(t(c(0, -1, 1)), rx) # sum of square 
  GLM(uptake ~ Type, CO2) # compare with the above

Run the code above in your browser using DataLab