Learn R Programming

gvcm.cat (version 1.2)

index: Index Function for Function gvcm.cat()

Description

index() computes three statements per variable; one indicating how many coefficients belong to this variable (index1), the second indicating whether this variable varies or not (index2), the third indicating wheter the variable is categorial and penalized or not.

Usage

index(formula, data)

Arguments

formula
an object of class "formula"; see gvcm.cat
data
a data frame; see gvcm.cat

Value

  • index1a vector; its length equals the number of the model's variables including the intercept, each entry gives the number of coefficients belonging to the according variable. An entry is 1 if the according variable 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 categorial covariates. An entry is 0 if the according covariate is not categorial, it is -1 if the according covariate is nominal, 1 if it is ordinal

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)
index(f, data)

Run the code above in your browser using DataLab