NOTE: model_summary
is preferred.
regress(
formula,
data,
family = NULL,
digits = 3,
robust = FALSE,
cluster = NULL,
test.rand = FALSE
)
No return value.
Model formula.
Data frame.
[Optional] The same as in glm
and glmer
(e.g., family=binomial
fits a logistic regression model).
Number of decimal places of output. Defaults to 3
.
[Only for lm
and glm
]
FALSE
(default), TRUE
(then the default is "HC1"
),
"HC0"
, "HC1"
, "HC2"
, "HC3"
, "HC4"
, "HC4m"
, or "HC5"
.
It will add a table with heteroskedasticity-robust standard errors (aka. Huber-White standard errors).
For details, see ?sandwich::vcovHC
and ?jtools::summ.lm
.
*** "HC1"
is the default of Stata, whereas "HC3"
is the default suggested by the sandwich
package.
[Only for lm
and glm
]
Cluster-robust standard errors are computed if cluster is set to the name of the input data's cluster variable or is a vector of clusters.
[Only for lmer
and glmer
]
TRUE
or FALSE
(default).
Test random effects (i.e., variance components) by using the likelihood-ratio test (LRT),
which is asymptotically chi-square distributed.
For large datasets, it is much time-consuming.
print_table
(print simple table)
model_summary
(highly suggested)
GLM_summary
HLM_summary
if (FALSE) {
## lm
regress(Temp ~ Month + Day + Wind + Solar.R, data=airquality, robust=TRUE)
## glm
regress(case ~ age + parity + education + spontaneous + induced,
data=infert, family=binomial, robust="HC1", cluster="stratum")
## lmer
library(lmerTest)
regress(Reaction ~ Days + (Days | Subject), data=sleepstudy)
regress(Preference ~ Sweetness + Gender + Age + Frequency +
(1 | Consumer), data=carrots)
## glmer
library(lmerTest)
data.glmm = MASS::bacteria
regress(y ~ trt + week + (1 | ID), data=data.glmm, family=binomial)
regress(y ~ trt + week + hilo + (1 | ID), data=data.glmm, family=binomial)
}
Run the code above in your browser using DataLab