Learn R Programming

gvcm.cat (version 1.3)

index: Functions to Build Design Matrices and Indices for Function gvcm.cat()

Description

design() builds design matrices considering special formula terms v() and p(). index() computes several indices with different information about each term of the formula.

Usage

design(formula, data)

index(dsgn, data)

Arguments

formula
an object of class "formula"; see gvcm.cat
data
a data frame; see gvcm.cat
dsgn
value of function design()

Value

  • Xthe model matrix
  • Termsthe according terms.object
  • mthe model frame
  • inteither 0, indicating that the intercept is varying, or 1 indicating that the intercept is constant
  • formulasorted version of the given formula, index vectors will refer to this formula
  • index1a vector; its length equals the number of the formula's terms including the intercept, each entry gives the number of coefficients belonging to the according term. An entry is 1 if the according term is metric, it equals the number of the coded variable's categories, if the variable is a factor. If a continuous variable is modified by a factor u the entry equals the number of u's categories
  • index2a vector of the same length as index1; indicates varying coefficients. An entry is 0 if the according coefficient is not varying, it is -1 if the according coefficient is nominal, 1 if it is ordinal
  • index3a vector of the same length as index1; indicates penalized covariates p(u). An entry is 0 if the according covariate is not penalized, it is -1 if the according covariate is nominal, 1 if it is ordinal or metric

See Also

Functions pest, abc

Examples

Run this code
## continues example of function simulation
f <- y ~ v(1,u) + v(x1,u) + v(x2,u)
dsgn <- design(f, data)
index(dsgn, data)

Run the code above in your browser using DataLab