summ.glm | R Documentation |
Generalized linear regression summaries with options
Description
summ()
prints output for a regression model in a fashion similar tosummary()
, but formatted differently with more options.
Usage
## S3 method for class 'glm'summ( model, scale = FALSE, confint = getOption("summ-confint", FALSE), ci.width = getOption("summ-ci.width", 0.95), robust = getOption("summ-robust", FALSE), cluster = NULL, vifs = getOption("summ-vifs", FALSE), digits = getOption("jtools-digits", default = 2), exp = FALSE, pvals = getOption("summ-pvals", TRUE), n.sd = 1, center = FALSE, transform.response = FALSE, scale.only = FALSE, data = NULL, model.info = getOption("summ-model.info", TRUE), model.fit = getOption("summ-model.fit", TRUE), model.coefs = getOption("summ-model.coefs", TRUE), which.cols = NULL, vcov = NULL, ...)
Arguments
model | A |
scale | If |
confint | Show confidence intervals instead of standard errors? Defaultis |
ci.width | A number between 0 and 1 that signifies the width of thedesired confidence interval. Default is |
robust | If not Default is This requires the |
cluster | For clustered standard errors, provide the column name ofthe cluster variable in the input data frame (as a string). Alternately,provide a vector of clusters. Note that you must set |
vifs | If |
digits | An integer specifying the number of digits past the decimal toreport in the output. Default is 2. You can change the default number ofdigits for all jtools functions with |
exp | If |
pvals | Show p values? If |
n.sd | If |
center | If you want coefficients for mean-centered variables but don'twant to standardize, set this to |
transform.response | Should scaling/centering apply to responsevariable? Default is |
scale.only | If you want to scale but not center, set this to |
data | If you provide the data used to fit the model here, that dataframe is used to re-fit the model (if |
model.info | Toggles printing of basic information on sample size,name of DV, and number of predictors. |
model.fit | Toggles printing of model fit statistics. |
model.coefs | Toggles printing of model coefficents. |
which.cols | Developmental feature. By providing columns by name,you can add/remove/reorder requested columns in the output. Not fullysupported, for now. |
vcov | You may provide your own variance-covariance matrix for theregression coefficients if you want to calculate standard errors insome way not accommodated by the |
... | Among other things, arguments are passed to |
Details
By default, this function will print the following items to theconsole:
The sample size
The name of the outcome variable
The chi-squared test, (Pseudo-)R-squared value and AIC/BIC.
A table with regression coefficients, standard errors, z values, andp values.
There are several options available for robust
. The heavylifting is done by sandwich::vcovHC()
, where those are betterdescribed.Put simply, you may choose from "HC0"
to "HC5"
. Based on therecommendation of the developers of sandwich, the default is set to"HC3"
. Stata's default is "HC1"
, so that choice may be betterif the goal is to replicate Stata's output. Any option that is understood byvcovHC()
will be accepted. Cluster-robust standard errors arecomputedif cluster
is set to the name of the input data's cluster variableor is a vector of clusters.
The scale
and center
options are performed viarefittingthe model with scale_mod()
and center_mod()
,respectively. Each of those in turn uses gscale()
for themean-centering and scaling.
Value
If saved, users can access most of the items that are returned inthe output (and without rounding).
coeftable | The outputted table of variables and coefficients |
model | The model for which statistics are displayed. This would bemost useful in cases in which |
Much other information can be accessed as attributes.
Author(s)
Jacob Long jacob.long@sc.edu
References
King, G., & Roberts, M. E. (2015). How robust standard errors exposemethodological problems they do not fix, and what to do about it.Political Analysis, 23(2), 159–179.\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/pan/mpu015")}
Lumley, T., Diehr, P., Emerson, S., & Chen, L. (2002). The Importance of theNormality Assumption in Large Public Health Data Sets. Annual ReviewofPublic Health, 23, 151–169.\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1146/annurev.publhealth.23.100901.140546")}
See Also
scale_mod()
can simply perform the standardization ifpreferred.
gscale()
does the heavy lifting for mean-centering and scalingbehind the scenes.
Other summ: summ.lm()
,summ.merMod()
,summ.rq()
,summ.svyglm()
Examples
## Dobson (1990) Page 93: Randomized Controlled Trial : counts <- c(18,17,15,20,10,20,25,13,12) outcome <- gl(3,1,9) treatment <- gl(3,3) print(d.AD <- data.frame(treatment, outcome, counts)) glm.D93 <- glm(counts ~ outcome + treatment, family = poisson) # Summarize with standardized coefficients summ(glm.D93, scale = TRUE)