Skip to contents

Multiple Linear Regression with Plain-English Interpretation

Usage

mlr_interpret(formula, data, conf.level = 0.95, context = NULL)

Arguments

formula

A formula of the form outcome ~ predictor1 + predictor2 + ...

data

A data frame containing the variables

conf.level

Confidence level. Default 0.95.

context

Optional description of the study design or sampling method, echoed back in the printed report. Default NULL.

Value

An object of class statease_mlr containing multiple regression results and interpretation. Use print() to display the formatted report.

Examples

df <- data.frame(
  exam_score  = c(23,45,12,67,34,89,56,43,78,90),
  study_hours = c(2,5,1,7,3,9,6,4,8,10),
  attendance  = c(60,80,50,90,70,95,85,75,88,92)
)
result <- mlr_interpret(exam_score ~ study_hours + attendance, data = df)
#> Warning: Sample size is small (n < 20). Interpret results with caution.
print(result)
#> 
#> -- statease Multiple Linear Regression Report -------------------
#>   Outcome      : exam_score
#>   Predictors   : study_hours, attendance
#>   N            : 10
#> -----------------------------------------------------------------
#>   Model Equation:
#>   exam_score = -2.664 + 8.240*study_hours + 0.141*attendance
#> -----------------------------------------------------------------
#>   Overall Model Fit:
#>   R-squared    : 0.9893 (large effect)
#>   Adj R-squared: 0.9862
#>   F-statistic  : 322.885 (df = 2, 7)  p = 0.0000
#>   The overall model is statistically significant (p = 0.0000 < alpha 0.05).
#> -----------------------------------------------------------------
#>   Assumption Checks:
#>     Normality (residuals)   : PASSED   (Shapiro-Wilk p = 0.759)
#>     Homoscedasticity        : PASSED   (non-constant variance test p = 0.385)
#>     Residual independence   : PASSED   (Durbin-Watson DW = 2.21, p = 0.710)
#>     Multicollinearity (VIF) : WARNING  (max VIF = 10.0, threshold = 5)
#> 
#>   NOTE: Assumption checks are diagnostic tools and may be
#>   influenced by sample size and other characteristics of the
#>   data. Passing a check does not prove that an assumption is
#>   satisfied, and a warning does not automatically invalidate
#>   the analysis. Interpret these results alongside your
#>   knowledge of the data.
#> -----------------------------------------------------------------
#>   Interpretation:
#> 
#>   study_hours
#>     Coefficient  : 8.240  (SE = 1.106)
#>     t-statistic  : 7.452
#>     p-value      : 0.0001  [significant]
#>     95% CI      : [5.626, 10.855]
#>     Direction    : positive (b = 8.240)
#> 
#>   attendance
#>     Coefficient  : 0.141  (SE = 0.227)
#>     t-statistic  : 0.620
#>     p-value      : 0.5549  [not significant]
#>     95% CI      : [-0.396, 0.677]
#>     Direction    : positive (b = 0.141)
#> -----------------------------------------------------------------
#>   Interpretation:
#>   The model explains 98.9% of the variance in exam_score
#>   (R-squared = 0.9893, large effect).
#>   Adjusted R-squared = 0.9862 accounting for
#>   the number of predictors in the model.
#> 
#>   Significant predictors: study_hours
#>   Non-significant predictors: attendance
#> -----------------------------------------------------------------
#>