Description Usage Arguments Value Author(s) Examples
Process the data needed for modelling
1 2 3 4 5 6 |
y |
the numeric response vector |
X |
the numeric matrix of covariates |
continuous |
logical vector specifying which covariates really are continous and can be included nonlinearly in a model (default: all covariates are continuous) |
nKnots |
number of (quantile-based) spline knots (default: 4) |
splineType |
type of splines to be used (default:
“linear”), see |
gPrior |
A g-prior class object. Defaults to a
hyper-g/n prior. See |
weights |
optionally a vector of positive weights (if not provided, a vector of ones) |
offsets |
this can be used to specify an _a priori_ known component to be included in the linear predictor during fitting. This must be a numeric vector of length equal to the number of cases (if not provided, a vector of zeroes) |
family |
distribution and link (as in the glm function) |
phi |
value of the dispersion parameter (defaults to 1) |
a list with the internally needed results.
Daniel Sabanes Bove daniel.sabanesbove@ifspm.uzh.ch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## get some data
attach(longley)
## try the function
md <- glmModelData(y=as.numeric(Employed > 64),
X=cbind(GNP, Armed.Forces),
family=binomial)
## look at the results
str(md)
## try again with cubic splines
md <- glmModelData(y=as.numeric(Employed > 64),
X=cbind(GNP, Armed.Forces),
nKnots=10L,
splineType="cubic",
family=binomial)
## look at the results
str(md)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.