OLS_REGRESSION {SIMPLE.REGRESSION}R Documentation

Ordinary least squares regression

Description

Provides SPSS- and SAS-like output for ordinary least squares simultaneous entry regression and hierarchical entry regression. The output includes the Anova Table (Type III tests), standardized coefficients, partial and semi-partial correlations, collinearity statistics, casewise regression diagnostics, plots of residuals and regression diagnostics.

Usage

OLS_REGRESSION(data, DV, forced=NULL, hierarchical=NULL, 
               COVARS=NULL,
               plot_type = 'residuals', 
               verbose=TRUE, ...)

Arguments

data

A dataframe where the rows are cases and the columns are the variables.

DV

The name of the dependent variable.
Example: DV = 'outcomeVar'

forced

(optional) A vector of the names of the predictor variables for a forced/simultaneous entry regression. The variables can be numeric or factors.
Example: forced = c('VarA', 'VarB', 'VarC')

hierarchical

(optional) A list with the names of the predictor variables for each step of a hierarchical regression. The variables can be numeric or factors.
Example: hierarchical = list(step1=c('VarA', 'VarB'), step2=c('VarC', 'VarD'))

COVARS

(optional) The name(s) of possible covariates variable for a moderated regression analysis.
Example: COVARS = c('CovarA', 'CovarB', 'CovarC')

plot_type

(optional) The kind of plots, if any. The options are:

  • 'residuals' (the default)

  • 'diagnostics' (for regression diagnostics), or

  • 'none' (for no plots).

Example: plot_type = 'diagnostics'

verbose

Should detailed results be displayed in console? The options are: TRUE (default) or FALSE. If TRUE, plots of residuals are also produced.

...

(dots, for internal purposes only at this time.)

Details

This function uses the lm function from the stats package, supplements the output with additional statistics, and it formats the output so that it resembles SPSS and SAS regression output. The predictor variables can be numeric or factors.

Good sources for interpreting residuals and diagnostics plots:

Value

An object of class "OLS_REGRESSION". The object is a list containing the following possible components:

modelMAIN

All of the lm function output for the regression model without interaction terms.

modelMAINsum

All of the summary.lm function output for the regression model without interaction terms.

anova_table

Anova Table (Type III tests).

mainRcoefs

Predictor coefficients for the model without interaction terms.

modeldata

All of the predictor and outcome raw data that were used in the model, along with regression diagnostic statistics for each case.

collin_diags

Collinearity diagnostic coefficients for models without interaction terms.

Author(s)

Brian P. O'Connor

References

Bodner, T. E. (2016). Tumble graphs: Avoiding misleading end point extrapolation when graphing interactions from a moderated multiple regression analysis. Journal of Educational and Behavioral Statistics, 41, 593-604.

Cohen, J., Cohen, P., West, S. G., & Aiken, L. S. (2003). Applied multiple regression/correlation analysis for the behavioral sciences (3rd ed.). Lawrence Erlbaum Associates.

Darlington, R. B., & Hayes, A. F. (2017). Regression analysis and linear models: Concepts, applications, and implementation. Guilford Press.

Hayes, A. F. (2018a). Introduction to mediation, moderation, and conditional process analysis: A regression-based approach (2nd ed.). Guilford Press.

Hayes, A. F., & Montoya, A. K. (2016). A tutorial on testing, visualizing, and probing an interaction involving a multicategorical variable in linear regression analysis. Communication Methods and Measures, 11, 1-30.

O'Connor, B. P. (1998). All-in-one programs for exploring interactions in moderated multiple regression. Educational and Psychological Measurement, 58, 833-837.

Pedhazur, E. J. (1997). Multiple regression in behavioral research: Explanation and prediction. (3rd ed.). Wadsworth Thomson Learning.

Examples

# forced (simultaneous) entry
head(data_Green_Salkind_2014)
OLS_REGRESSION(data=data_Green_Salkind_2014, DV='injury', 
               forced = c('quads','gluts','abdoms','arms','grip'))

# hierarchical entry
OLS_REGRESSION(data=data_Green_Salkind_2014, DV='injury', 
               hierarchical = list( step1=c('quads','gluts','abdoms'), 
                                    step2=c('arms','grip')) )


[Package SIMPLE.REGRESSION version 0.1.9 Index]