Learn R Programming

informR (version 1.0-5)

gen.intercepts: Generate Baserate Statistics

Description

Generates baserate statistics in statslist form for direct input into rem() in Butts's relevent R package.

Usage

gen.intercepts(evl, basecat=NULL, type=1, contr=TRUE)

Arguments

evl
An eventlist. Possibly passed from gen.evl()
basecat
A string indicating which event to treat as the baseline group. Default is NULL, which uses the first event in evl$event.key.
type
An integer indicating the location of the statistics in the statslist. 1 for global, 2 for local. Default is global.
contr
Logical. Should the routine use SAS-like contrasts to generate the statistics? Defaults to true (which is faster than the alternative).

Value

A list containing:
list
An i,j,k array consisting of the i'th event's j by k identity contrast matrix.

See Also

slbind,gen.id

Examples

Run this code
rawevents<-sample(rep(c("ran","eat","stay","eat","ran","play"),5))
actors<-rep(c("Jim","Bill","Pete"),10)
eventlist<-gen.evl(cbind(rawevents,actors))
baserates<-gen.intercepts(eventlist)
baserates[[1]][[1]][1,,]

#Compare with:
baserates<-gen.intercepts(eventlist,contr=FALSE)
baserates[[1]][[1]][1,,]

Run the code above in your browser using DataLab