logregC | R Documentation |
Logistic regression analysis function with many useful features. Its standard output included a table of coefficients, table of deviance residuals, and summary of additional model information. Options include weighting observations, additional reports on odds ratios, ANOVA, multiple measures of model fit, proportional reduction in error, and diagnostic plots of residuals.
logregC(formula, w, data, digits = 3, orci = FALSE, fit.stats = FALSE,
anova = FALSE, pre = FALSE, printC = FALSE, res.plots = FALSE, ...)
formula |
should be in dataset$dv ~ datatset$iv1 + dataset$iv2 unless dataset specified in optional data argument. |
w |
(Optional) Sampling weights of variable, must be numeric; should be in dataset$weightvar form unless dataset specified in optional data argument. |
data |
(Optional) Name of dataset that contains dv, iv (and w) variables. |
digits |
(Optional) Number of decimal places reported in result (defaults to 2). |
orci |
(Optional) Do you want table reporting odds ratios for coefficients with confidence intervals? (default: FALSE) |
fit.stats |
(Optional) Do you want a table of assorted model fit statistics? (default: FALSE) |
anova |
(Optional) Do you want ANOVA table reported? (default: FALSE) |
pre |
(Optional) Do you want table reporting proportion reduction in error achieved by model? This is a Lambda-style measure of model fit. (default: FALSE) |
printC |
(Optional) Do you want results printed to .html file in your working directory? Default is FALSE. Set to TRUE to print results. |
res.plots |
(Optional) Do you want a set of diagnostic plots of model residuals? (default: FALSE) |
... |
(Optional) Additional arguments passed to |
Returns a glm (unweighted models) or svyglm (weighted models) object.
Logistic Regression Analysis with RCPA3 Package's logregC Function 13:36
Complete Playlist of RCPA3 Package Tutorial Videos, includes video for this function and many more.
Philip H. Pollock and Barry C. Edwards, An R Companion to Political Analysis, 3rd Edition (Thousand Oaks, CA: Sage Publications, Forthcoming 2022), Chapter 14.
Philip H. Pollock and Barry C. Edwards, The Essentials of Political Analysis, 6th Edition (Thousand Oaks, CA: Sage Publications, 2020), Chapter 9. ISBN-13: 978-1506379616; ISBN-10: 150637961.
R Tutorials & Resources for Logistic Regression, compiled by Barry C. Edwards
Sage Edge Resources for Political Analysis Series, for streaming videos, flashcards, and more student resources for textbooks by Pollock and Edwards, from Sage Publications.
Political Science Data Web Site: Find datasets for your own research and resources to help with the analysis.
library(RCPA3)
# basic usage with variable vectors
logregC(states$battleground2020 ~ states$vep16.turnout)
# with post-estimation analysis
logregC(states$battleground2020 ~ states$vep16.turnout, orci=TRUE, fit.stats=TRUE,
anova=TRUE, pre=TRUE, res.plots=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.