RanTest: Test with Random Effects

View source: R/RanTest.R

RanTestR Documentation

Test with Random Effects

Description

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

Usage

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

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 random factor are regarded as random effects.

Type

Sum of square type to be used as contrast

eps

Less than this value is considered as zero.

Details

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

Value

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

Author(s)

Kyun-Seop Bae k@acr.kr

Examples

  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)

sasLM documentation built on Oct. 2, 2024, 9:06 a.m.