index: Functions to Build Design Matrices and Indices for Function...

Description Usage Arguments Details Value References See Also Examples

Description

design() builds design matrices for function gvcm.cat; index() computes indices with information about the terms of the formula.

Usage

1
2
3

Arguments

formula

an object of class "formula"; see gvcm.cat

data

a data frame; see gvcm.cat

dsgn

value of function design()

Details

Function index returns a matrix with one indicator vector per row. The columns refer to the elements of the formula (same order). The indicator/indices are:

Value

X

the model matrix

Terms

the according terms.object

m

the model frame

int

either 0, indicating that the intercept is varying, or 1 indicating that the intercept is constant

formula

sorted version of the given formula, index vectors will refer to this formula

a matrix

value of function index

References

Oelker, M.-R., J. Gertheiss and G. Tutz (2012). Regularization and model melection with categorial predictors and effect modifiers in generalized linear models. Department of Statistics at the University of Munich: Technical Report 122.

See Also

Functions pest, abc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## example for function simulation()
covariates <- list(x1=list("unif", c(0,2)),
                  x2=list("unif", c(0,2)),
                  x3=list("unif", c(0,2)),
                  u=list("multinom",c(0.3,0.4,0.3), "nominal")
                  )
true.f <- y ~ 1 + v(x1,u) + x2
true.coefs <- c(0.2,  0.3,.7,.7, -.5)
data <- simulation(400, covariates, NULL, true.f, true.coefs , binomial(), seed=456)
## example for function index()
f <- y ~ v(1,u) + v(x1,u) + v(x2,u)
dsgn <- design(f, data)
index(dsgn, data)

gvcm.cat documentation built on May 1, 2019, 10:13 p.m.

Related to index in gvcm.cat...