Learn R Programming

sasLM (version 1.0.1)

RanTest: Test with Random Effects

Description

Hypothesis test with a specified type of SS using random effects as error terms. This corresponds to SAS PROC GLM's RANDOM /TEST statement.

Usage

RanTest(Formula, Data, Random="", Type=3, eps=1e-8)

Value

Returns ANOVA and E(MS) tables with the specified type of SS.

Arguments

Formula

a conventional formula for a linear model

Data

a data.frame to be analyzed

Random

a vector of random effects. All should be specified as primary terms, not as interaction terms. All interaction terms with a random factor are regarded as random effects.

Type

Sum of squares type to be used as contrast

eps

A value less than this is considered as zero.

Author

Kyun-Seop Bae k@acr.kr

Details

Type can be from 1 to 3. All interaction terms with a random factor are regarded as random effects. Here the error term should not be the MSE.

Examples

Run this code
  RanTest(log(CMAX) ~ SEQ/SUBJ + PRD + TRT, BEdata, Random="SUBJ")
  fBE = log(CMAX) ~ ADM/SEQ/SUBJ + PRD + TRT
  RanTest(fBE, BEdata, Random=c("ADM", "SUBJ"))
  RanTest(fBE, BEdata, Random=c("ADM", "SUBJ"), Type=2)
  RanTest(fBE, BEdata, Random=c("ADM", "SUBJ"), Type=1)

Run the code above in your browser using DataLab