prepareData {OrdFacReg}R Documentation

Prepare input data to be used in active set algorithm

Description

This function takes a matrix consisting of quantitative variables, unordered, and ordered factors and generates the corresponding matrix of dummy variables, and some further quantities that are used by the active set algorithm in ordFacReg and ordFacRegCox.

Usage

prepareData(Z, fact = NA, ordfact, ordering = NA, intercept = TRUE)

Arguments

Z

Matrix with quantitative variables in the first c columns, unordered factors in the next columns, and finally unordered factors. The latter two need to have levels from 1 to j.

fact

Specify columns in Z that correspond to unordered factors.

ordfact

Specify columns in Z that correspond to ordered factors.

ordering

Vector of the same length as ordfact. Specifies ordering of ordered factors: "i" means that the coefficients of the corresponding ordered factor are estimated in non-decreasing order and "d" means non-increasing order. See the examples in ordFacReg for details.

intercept

If TRUE, an intercept (= column of all 1's) is added to the design matrix.

Value

Quantities that are used by the active set algorithm. The names of the objects roughly correspond to those in Rufibach (2010).

Author(s)

Kaspar Rufibach (maintainer)
kaspar.rufibach@gmail.com
http://www.kasparrufibach.ch

References

Rufibach, K. (2010). An Active Set Algorithm to Estimate Parameters in Generalized Linear Models with Ordered Predictors. Comput. Statist. Data Anal., 54, 1442-1456.

See Also

This function is used by the ordered factor computation functions ordFacReg and ordFacRegCox.


[Package OrdFacReg version 1.0.6 Index]