Description Usage Arguments Details Value References See Also Examples
design()
builds design matrices for function gvcm.cat
; index()
computes indices with information about the terms of the formula.
1 2 3 |
formula |
an object of class |
data |
a data frame; see |
dsgn |
value of function |
Function index
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 factor u
the entry equals
the number of u
's categories
index2
: 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
index2b
: conforms to indicator b_j in Oelker et. al. 2012
index3
: 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
index4
: indicates penalized covariates grouped(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
index5
: experimental
index6
: indicates penalized covariates sp
index7
: indicates penalized covariates SCAD
. 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
index8
: indicates penalized covariates elastic
. 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
index9
: experimental
X |
the model matrix |
Terms |
the according |
m |
the model frame |
int |
either 0, indicating that the intercept is varying, or 1 indicating that the intercept is constant |
formula |
sorted version of the given formula, |
a matrix |
value of function |
Oelker, M.-R., J. Gertheiss and G. Tutz (2012). Regularization and model melection with categorial predictors and effect modifiers in generalized linear models. Department of Statistics at the University of Munich: Technical Report 122.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## example for function simulation()
covariates <- list(x1=list("unif", c(0,2)),
x2=list("unif", c(0,2)),
x3=list("unif", c(0,2)),
u=list("multinom",c(0.3,0.4,0.3), "nominal")
)
true.f <- y ~ 1 + v(x1,u) + x2
true.coefs <- c(0.2, 0.3,.7,.7, -.5)
data <- simulation(400, covariates, NULL, true.f, true.coefs , binomial(), seed=456)
## example for function index()
f <- y ~ v(1,u) + v(x1,u) + v(x2,u)
dsgn <- design(f, data)
index(dsgn, data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.