Learn R Programming

radiant (version 0.1.95)

plot.reg_predict: Plot method for the predict.regression function

Description

Plot method for the predict.regression function

Usage

"plot"(x, reg_xvar = "", reg_facet_row = ".", reg_facet_col = ".", reg_color = "none", reg_conf_level = 0.95, ...)

Arguments

x
Return value from predict.regression.
reg_xvar
Variable to display along the X-axis of the plot
reg_facet_row
Create vertically arranged subplots for each level of the selected factor variable
reg_facet_col
Create horizontally arranged subplots for each level of the selected factor variable
reg_color
Adds color to a scatter plot to generate a heat map. For a line plot one line is created for each group and each is assigned a different colour
reg_conf_level
Confidence level to use for prediction intervals (.95 is the default). Note that the error bars for predicitions are approximations at this point.
...
further arguments passed to or from other methods

Details

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

See Also

regression to generate the result

summary.regression to summarize results

plot.regression to plot results

predict.regression to generate predictions

Examples

Run this code
result <- regression("diamonds", "price", c("carat","clarity"))
pred <- predict(result, reg_predict_cmd = "carat = 1:10")
plot(pred, reg_xvar = "carat")
result <- regression("diamonds", "price", c("carat","clarity"), reg_int_var = "carat:clarity")
dpred <- getdata("diamonds") %>% slice(1:100)
pred <- predict(result, reg_predict_data = "dpred")
plot(pred, reg_xvar = "carat", reg_color = "clarity")

Run the code above in your browser using DataLab