| lm_model {psycModel} | R Documentation | 
Linear Regressions / ANOVA / ANCOVA
Description
 
Fit a linear regression using lm(). Linear regression is used to explore the effect of continuous variables / categorical variables in predicting a normally-distributed continuous variables.
Usage
lm_model(
  data,
  response_variable,
  predictor_variable,
  two_way_interaction_factor = NULL,
  three_way_interaction_factor = NULL,
  quite = FALSE
)
Arguments
data | 
 
  | 
response_variable | 
 response variable. Support   | 
predictor_variable | 
 predictor variable. Support   | 
two_way_interaction_factor | 
 two-way interaction factors. You need to pass 2+ factor. Support   | 
three_way_interaction_factor | 
 three-way interaction factor. You need to pass exactly 3 factors. Specifying three-way interaction factors automatically included all two-way interactions, so please do not specify the two_way_interaction_factor argument. Support   | 
quite | 
 suppress printing output  | 
Value
an object class of lm representing the linear regression fit
Examples
fit <- lm_model(
  data = iris,
  response_variable = Sepal.Length,
  predictor_variable = dplyr::everything(),
  two_way_interaction_factor = c(Sepal.Width, Species)
)