Description Usage Arguments Value References Examples
View source: R/SL.glm.manning.R
This function implements the estimator of Manning and Mullahy (2001). The estimator adaptively selects a link function and family based on the skewness and kurtosis of the data. Some of the family/link functions recommended by Manning are numerically unstable and so this function returns Duan's smearing estimate if the GLM fitting step breaks down.
1 2 3 4 5 6 7 8 9 10 11 |
Y |
A numeric outcome variable |
X |
A |
newX |
A |
family |
Gaussian only |
obsWeights |
Observation-level weights (not currently used) |
kCut |
Cut point for kurtosis |
lambdaCut |
Cut points for skewness |
startNLS |
Starting values for the non-linear least squares |
... |
Other arguments (not currently used) |
pred
Predicted outcomes based on predictors in newX
fit
A list with named entries object
(the fitted regression model object)
Manning WG, Mullahy J (2001). “Estimating log models: to transform or not to transform?” Journal of Health Economics, 20(4), 461–494.
1 2 3 4 5 6 7 | # load cost data
data(cost_data)
# fit manning model
fit_glm.manning <- SL.glm.manning(Y = cost_data$totalcost, X = cost_data[, c("female", "race")],
newX = cost_data[, c("female", "race")])
# get back predictions
pred_glm.manning <- predict(fit_glm.manning$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.