Learn R Programming

hmmm (version 1.0-4)

marg.list: lists of marginal sets

Description

An easy option to define the first input argument marg of the function `hmmm.model' which specifies the list of marginal sets of a hmm model.

Usage

marg.list(all.m, sep = "-", mflag = "marg")

Arguments

all.m

A character vector with one element for every marginal set, see below

sep

The separator used between logits type, default "-"

mflag

The symbol used to denote variables that are marginalized, default "marg"

Value

The list marg used as first input argument in `hmmm.model' -- see the function `hmmm.model'.

Details

all.m is a string indicating the logit types used to build the interactions in each marginal set. For each variable in the marginal set the corresponding logit symbol is inserted ("b" baseline, "g" global, "c" continuation, "rc" reverse continuation, "r" recursive, "l" local). Symbols are separated by sep and the variables not included in the marginal set are denoted by mflag. So, for example, "marg-g-c" indicates a marginal set involving variables 2, 3 with global and continuation logits respectively.

References

Colombi R, Giordano S, Cazzaro M (2014) hmmm: An R Package for hierarchical multinomial marginal models. Journal of Statistical Software, 59(11), 1-25, URL http://www.jstatsoft.org/v59/i11/.

See Also

hmmm.model

Examples

Run this code
# NOT RUN {
data(madsen)
marginals<-c("m-m-b-b","g-m-b-b","m-g-b-b","g-g-b-b")
margi<-marg.list(marginals,mflag="m")
names<-c("Inf","Sat","Co","Ho")
model<-hmmm.model(marg=margi,lev=c(3,3,2,4),names=names)
print(model)
# }

Run the code above in your browser using DataLab