RanTest: Test with Random Effects

View source: R/RanTest.R

RanTestR Documentation

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)

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.

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.

Value

Returns ANOVA and E(MS) tables with the specified type of 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 June 15, 2026, 9:07 a.m.