Learn R Programming

radiant (version 0.1.95)

regression: Linear regression using OLS

Description

Linear regression using OLS

Usage

regression(dataset, reg_dep_var, reg_indep_var, data_filter = "", reg_int_var = "", reg_check = "")

Arguments

dataset
Dataset name (string). This can be a dataframe in the global environment or an element in an r_data list from Radiant
reg_dep_var
The dependent variable in the regression
reg_indep_var
Independent variables in the regression
data_filter
Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")
reg_int_var
Interaction terms to include in the model
reg_check
"standardize" to see standardized coefficient estimates. "stepwise" to apply step-wise selection of variables in estimation

Value

A list of all variables used in regression as an object of class regression

Details

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

See Also

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"))
result <- regression("diamonds", "price", c("carat","clarity"), reg_check = "standardize")

Run the code above in your browser using DataLab