| Fx_glm {OptimalDesign} | R Documentation |
Matrix of candidate regressors for a generalized linear model
Description
Creates the matrix of all candidate regressors for a linearization of a generalized linear model.
Usage
Fx_glm(formula, theta0, glm.model="bin-logit", lower=NULL, upper=NULL,
n.levels=NULL, echo=TRUE)
Arguments
formula |
the formula of the linear part of the model. The rules for creating the formula are standard for R but: 1) the formula must not contain the dependent variable (it is one-sided); 2) the |
theta0 |
the |
glm.model |
the type of the generalized linear model. Available models are |
lower |
the |
upper |
the |
n.levels |
the |
echo |
Print the call of the function? |
Details
For mathematical details, see the referenced paper.
Value
The n times m matrix of all candidate regressors of a generalized linear regression model linearized in theta0.
Author(s)
Radoslav Harman, Lenka Filova
References
Atkinson AC, Woods DC (2015). Designs for generalized linear models. Handbook of Design and Analysis of Experiments, 471-514.
See Also
Fx_cube, Fx_simplex, Fx_blocks, Fx_survival, Fx_dose
Examples
# The logistic model with second-order predictors x1, x2 in [-1,1]
# discretized into 21 points and theta0=c(1, 2, 2, -1, -1.5, 1.5)
form.quad <- ~ x1 + x2 + I(x1*x2) + I(x1^2) + I(x2^2)
Fx <- Fx_glm(form.quad, c(1, 2, 2, -1, -1.5, 1.5),
glm.model="bin-logit", n.levels=c(21,21))
# The locally D-optimal approximate design
w <- od_REX(Fx)$w.best
Fx.lin <- Fx_cube(form.quad, n.levels=c(21,21)) # Just for the plot
od_plot(Fx, w, Fx.lin[, 2:3], dd.size=2)
## Not run:
#The GLM with Poisson link and 2 linear predictors x1,x2 in [-1,1]
# discretized into 21 points and theta0=c(0,2,2)
Fx <- Fx_glm(~x1+x2, c(0, 2, 2), glm.model="Poisson-log", n.levels=c(21, 21))
# The locally D-optimal exact design of size 50 without replications
w <- od_KL(Fx, 50, bin=TRUE, t.max=5)$w.best
Fx.lin <- Fx_cube(~x1+x2, n.levels=c(21, 21))
od_plot(Fx, w, Fx.lin[, 2:3], w.lim=Inf)
## End(Not run)