- model
A regression model of type lm
, glm
,
svyglm
, or lme4::merMod. Other model types
may work as well but are not tested.
- ...
Arguments passed on to gscale()
.
- binary.inputs
Options for binary variables. Default is "0/1"
;
"0/1"
keeps original scale; "-0.5,0.5"
rescales 0 as -0.5
and
1 as 0.5; center
subtracts the mean; and full
treats them
like other continuous variables.
- n.sd
How many standard deviations should you divide by for
standardization? Default is 1, though some prefer 2.
- center
Default is TRUE
. If TRUE
, the predictors are
also
mean-centered. For binary predictors, the binary.inputs
argument
supersedes this one.
- scale.response
Should the response variable also be rescaled? Default
is FALSE
.
- center.only
Rather than actually scale predictors, just mean-center
them.
- scale.only
A logical value indicating whether you would like to scale
the values, but not mean-center them.
- data
If you provide the data used to fit the model here, that data
frame is used to re-fit the model instead of the stats::model.frame()
of the model. This is particularly useful if you have variable
transformations or polynomial terms specified in the formula.
- vars
A character vector of variable names that you want to be
scaled. If NULL, the default, it is all predictors.
- 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
contr.wec()
from the wec
package is used to do this. See
that package's documentation and/or Grotenhuis et al. (2016) for more
info.