library("psych350lab")
# Using Superman data: predict rt_critics_score from year and clark_age
result <- linear_reg_answers(
psych350data::superman,
criterion = "rt_critics_score",
quant_predictors = c("year", "clark_age"),
quant_labels = c("Year", "Clark's Age")
)
# Access model results
result$Model
result$Bivariate
result$Regression_WeightsMultiple Linear Regression Analysis
Description
Performs a multiple linear regression analysis with separate handling of quantitative and binary predictors, including univariate, bivariate, and multivariate results with interpretation categories (a-d). All numeric values stored unrounded.
Usage
linear_reg_answers(
data,
criterion,
quant_predictors = NULL,
binary_predictors = NULL,
quant_labels = NULL,
binary_labels = NULL,
criterion_label = NULL,
verbose = FALSE
)
Arguments
data
|
A data frame or tibble. |
criterion
|
Character string. Name of the criterion (dependent) variable. |
quant_predictors
|
Character vector or NULL. Names of quantitative predictors.
|
binary_predictors
|
Character vector or NULL. Names of binary predictors.
|
quant_labels
|
Character vector or NULL. Display labels for quantitative predictors.
|
binary_labels
|
Character vector or NULL. Display labels for binary predictors.
|
criterion_label
|
Character string or NULL. Display label for the criterion.
|
verbose
|
Logical. Print diagnostic information. Default is FALSE.
|
Value
A list with elements (all numeric values unrounded).