center_mod
(previously known as center_lm
) takes fitted regression models
and meancenters the
continuous variables in the model to aid interpretation, especially in
the case of models with interactions. It is a wrapper to
scale_mod
.
center_mod(model, binary.inputs = "0/1", center.response = FALSE, data = NULL, apply.weighted.contrasts = getOption("jtoolsweighted.contrasts", FALSE))
model  A regression model of type 

binary.inputs  Options for binary variables. Default is 
center.response  Should the response variable also be centered?
Default is 
data  If you provide the data used to fit the model here, that data
frame is used to refit the model instead of the 
apply.weighted.contrasts  Factor variables cannot be scaled, but you
can set the contrasts such that the intercept in a regression model will
reflect the true mean (assuming all other variables are centered). If set
to TRUE, the argument will apply weighted effects coding to all factors.
This is similar to the R default effects coding, but weights according to
how many observations are at each level. An adapted version of

The functions returns a lm
or glm
object, inheriting
from whichever class was supplied.
This function will meancenter all continuous variables in a
regression model for ease of interpretation, especially for those models
that have
interaction terms. The mean for svyglm
objects is calculated using
svymean
, so reflects the surveyweighted mean. The weight variables
in svyglm
are not centered, nor are they in other lm
family
models.
This function reestimates the model, so for large models one should expect a runtime equal to the first run.
Bauer, D. J., & Curran, P. J. (2005). Probing interactions in fixed and multilevel regression: Inferential and graphical techniques. Multivariate Behavioral Research, 40(3), 373400.
Cohen, J., Cohen, P., West, S. G., & Aiken, L. S. (2003). Applied multiple regression/correlation analyses for the behavioral sciences (3rd ed.). Mahwah, NJ: Lawrence Erlbaum Associates, Inc.
sim_slopes
performs a simple slopes analysis.
interact_plot
creates attractive, userconfigurable plots of
interaction models.
Other standardization, scaling, and centering tools: center
,
gscale
, scale_mod
,
standardize
fit < lm(formula = Murder ~ Income * Illiteracy, data = as.data.frame(state.x77)) fit_center < center_mod(fit) # With weights fitw < lm(formula = Murder ~ Income * Illiteracy, data = as.data.frame(state.x77), weights = Population) fitw_center < center_mod(fitw) # With svyglm if (requireNamespace("survey")) { library(survey) data(api) dstrat < svydesign(id = ~1, strata = ~stype, weights = ~pw, data = apistrat, fpc =~ fpc) regmodel < svyglm(api00 ~ ell * meals, design = dstrat) regmodel_center < center_mod(regmodel) }#>#>#>#>#> #>#>#> #>