Description Usage Arguments Value Examples
Generalized linear model with gamma family and user-specified link function
1 | SL.glm.gamma(Y, X, newX, family, obsWeights, link = "log", ...)
|
Y |
A numeric outcome variable |
X |
A |
newX |
A |
family |
Gaussian only |
obsWeights |
Observation-level weights (not currently used) |
link |
Link function |
... |
Other arguments (not currently used) |
pred
Predicted outcomes based on predictors in newX
fit
A list with named entries object
(the fitted glm
regression object)
1 2 3 4 5 6 7 | # load cost data
data(cost_data)
# fit gamma glm with log link model
fit_glm.gamma <- SL.glm.gamma(Y = cost_data$totalcost, X = cost_data[, c("female", "race")],
newX = cost_data[, c("female", "race")])
# get back predictions
pred_glm.gamma <- predict(fit_glm.gamma$fit, newdata = cost_data[,c("female", "race")])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.