Learn R Programming

radiant (version 0.1.95)

predict.glm_reg: Predict method for the glm_reg function

Description

Predict method for the glm_reg function

Usage

"predict"(object, glm_predict_cmd = "", glm_predict_data = "", ...)

Arguments

object
Return value from glm_reg
glm_predict_cmd
Generate predictions using a command. For example, `pclass = levels(pclass)` would produce predictions for the different levels of factor `pclass`. To add another variable use a `,` (e.g., `pclass = levels(pclass), age = seq(0,100,20)`)
glm_predict_data
Provide the name of a dataframe to generate predictions (e.g., "titanic"). The dataset must contain all columns used in the estimation
...
further arguments passed to or from other methods

Details

See http://vnijs.github.io/radiant/quant/glm_reg.html for an example in Radiant

See Also

glm_reg to generate the result

summary.glm_reg to summarize results

plot.glm_reg to plot results

plot.glm_predict to plot prediction output

Examples

Run this code
result <- glm_reg("titanic", "survived", c("pclass","sex"), glm_levels = "Yes")
predict(result, glm_predict_cmd = "pclass = levels(pclass)")
predict(result, glm_predict_cmd = "sex = c('male','female')")

Run the code above in your browser using DataLab