slbind: Combine Statlist Arrays

Description Usage Arguments Details Note Author(s) See Also Examples

Description

Combines statslist arrays using a wrapper for abind() in the abind package.

Usage

1
slbind(sformstats, statslist, type = 1, new.names=FALSE,...)

Arguments

sformstats

An sformstats object, possibly passed from sfl2sl

statslist

A statslist object, possibly passed from gen.intercepts

type

Indicates where the combining is going to occur in the output statslist. 1 for global, 2 for local.

new.names

Either logical or character string. Choose the ouput variable names. See details.

...

Additional arguments passed to sf2nms() if new.names=TRUE. See details

Details

The new.names parameter defaults to FALSE, which sets the variable names in the output to be whatever was passed from the names of the kth elements of each ijk array in sformstats, as in the default behavior in abind(). Setting new.names to TRUE tries to guess variable names using sf2nms. If TRUE, then ... must contain an event.key from the eventlist object that statslist was built upon (e.g, event.key=eventlist$event.key). If new.names is passed as a character vector, then its length must be equal to the number of the kth elements of each ijk array in sformstats.

In the case that new.names is TRUE, it is possible to retrieve the original variable names by: names(dimnames(output[[x]][[type]])), where output is the statslist generated by slbind(), x is any index, and type is type as defined above.

Note

slbind can accept abind arguments.

Author(s)

Christopher Steven Marcum

See Also

sfl2sl,gen.intercepts,sf2nms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rawevents<-sample(rep(c("ran","eat","stay","eat","ran","play"),50))
actors<-rep(c("Jim","Bill","Pete"),100)
evmat<-cbind(rawevents,actors)
eventlist<-gen.evl(evmat)
beta.ints<-gen.intercepts(eventlist)
beta.sforms<-gen.sformlist(eventlist,c("a+b","bb"))
statslist<-slbind(beta.sforms,beta.ints)
statslist[[1]][[1]][1:3,,]

#Compare with:
statslist<-slbind(beta.sforms,beta.ints,new.names=TRUE,event.key=eventlist$event.key)
dimnames(statslist[[1]][[1]])

informR documentation built on May 1, 2019, 9:22 p.m.