Understanding the Results
The output includes four sections matching SPSS REGRESSION output:
Model Summary: R, R-squared, Adjusted R-squared, and
Standard Error of the Estimate. R-squared tells you how much variance
in the dependent variable is explained by the predictors.
ANOVA: Tests whether the overall model is significant.
A significant F-test means at least one predictor matters.
Coefficients: B (unstandardized), Beta (standardized),
t-value, p-value, and confidence intervals for each predictor.
Descriptives: Mean, SD, and N for all variables in the model.
Interpreting coefficients:
B (unstandardized): For each 1-unit increase in the predictor,
the dependent variable changes by B units
Beta (standardized): Allows comparison across predictors with
different scales. Larger absolute Beta = stronger effect
p-value: Values below 0.05 indicate statistically significant
predictors
When to Use This
Use linear_regression() when:
Your dependent variable is continuous (e.g., income, satisfaction score)
You want to predict an outcome from one or more predictors
You need standardized coefficients to compare predictor importance
For binary outcomes (yes/no, 0/1), use logistic_regression instead.
Technical Details
Missing Data: By default, listwise deletion is used (matching SPSS
REGRESSION /MISSING LISTWISE). Set use = "pairwise" to match SPSS
/MISSING PAIRWISE, which computes the regression from a pairwise
covariance matrix. Pairwise deletion retains more cases and produces
results closer to SPSS output when data has varying patterns of missingness.
Weights: When weights are specified, they are treated as frequency
weights (matching SPSS WEIGHT BY behavior). The model is fitted using weighted
least squares via lm(weights = ...).
Standardized Coefficients: Beta = B * (SD_x / SD_y). This matches
the SPSS standardized coefficient output. Not available for the intercept.
For dummy-coded factor terms (factors = "dummy"), the SD of the
contrast column from the design matrix is used.
Factor Predictors: By default (factors = "dummy"),
factor predictors are expanded into L - 1 contrasts via
R's stats::model.matrix(), matching base R lm(): unordered
factors get treatment (dummy) contrasts against the first level, while
ordered factors get R's default polynomial contrasts
(.L/.Q/.C terms). Pass
factors = "numeric" to silently coerce factor levels to their
integer codes (SPSS REGRESSION default). The "numeric" mode is
required to reproduce SPSS results for ordinal predictors like
education or Likert scales that SPSS treats as continuous.
Grouped Analysis: When data is grouped via
dplyr::group_by(), a separate regression is run for each group
(matching SPSS SPLIT FILE BY).