design() builds design matrices for function gvcm.cat; index() computes indices with information about the terms of the formula.design(formula, data)
index(dsgn, data = data, formula = formula)"formula"; see gvcm.catgvcm.catdesign()terms.objectindex vectors will refer to this formulaindexindex returns a matrix with one indicator vector per row. The columns refer to the elements of the formula (same order).
The indicator/indices are:
index1: gives the number of coefficients belonging to each term in the formula.
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 factoruthe entry equals
the number ofu's categoriesindex2: 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 ordinalindex2b: conforms to indicator$b_j$in Oelker et. al. 2012index3: indicates penalized covariatesp(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 metricindex4: indicates penalized covariatesgrouped(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 metricindex5: experimentalindex6: indicates penalized covariatesspindex7: indicates penalized covariatesSCAD. 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 metricindex8: indicates penalized covariateselastic. 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 metricindex9: experimentalpest, abc## 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