prepareData {OrdFacReg} | R Documentation |
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
.
prepareData(Z, fact = NA, ordfact, intercept = TRUE)
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. |
intercept |
If TRUE , an intercept (= column of all 1's) is added to the design matrix. |
Quantities that are used by the active set algorithm. The names of the objects roughly correspond to those in Rufibach (2009).
Kaspar Rufibach (maintainer)
kaspar.rufibach@ifspm.uzh.ch
http://www.biostat.uzh.ch/aboutus/people/rufibach.html
Rufibach, K. (2009) An Active Set Algorithm to Estimate Parameters in Generalized Linear Models with Ordered Predictors. Preprint, available at http://arxiv.org/abs/0902.0240.
This function is used by the ordered factor computation functions ordFacReg
and ordFacRegCox
.