# NOT RUN {
fit <- lm(formula = Murder ~ Income * Illiteracy, data = as.data.frame(state.x77))
fit_scale <- scale_lm(fit)
fit_scale <- scale_lm(fit, center = TRUE)
# With weights
fitw <- lm(formula = Murder ~ Income * Illiteracy,
data = as.data.frame(state.x77),
weights = Population)
fitw_scale <- scale_lm(fitw)
fitw_scale <- scale_lm(fitw, center = TRUE, binary.input = "0/1")
# With svyglm
library(survey)
data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
regmodel <- svyglm(api00~ell*meals,design=dstrat)
regmodel_scale <- scale_lm(regmodel)
regmodel_scale <- scale_lm(regmodel, binary.input = "0/1")
# }
Run the code above in your browser using DataLab