Description Usage Arguments Value Author(s) References See Also Examples
Makes summary table out of multiple heckman regression results, for multiple candidates and groups
1 | goodman_generalize(cand_vector, race_group, total, data, table_names, ...)
|
cand_vector |
Character vector of candidate names, taken from the dataset |
race_group |
Character vector of formula, e.g., "~ pct_latino" |
total |
Character vector (e.g., "totvote") of total variable name from data, variable in data is numeric |
data |
data.frame() object containing the data |
table_names |
Character vector of table names with same length as race_group. Used for formatting output |
... |
Arguments passed onto lm() function |
Object of class data.frame() returned containing table summary of all the Goodman regressions
Loren Collingwood <loren.collingwood@ucr.edu>
eiPack King et. al. (http://gking.harvard.edu/eiR) L. A. Goodman. Ecological regressions and behavior of individuals. American Sociological Review, 1953.
1 2 3 4 5 6 7 8 9 | # Load corona data
data(corona)
# Generate character vectors
cands <- c("pct_husted","pct_spiegel","pct_ruth","pct_button","pct_montanez","pct_fox")
race_group3 <- c("~ pct_hisp", "~ pct_asian", "~ pct_white")
# Goodman Regression
table_names <- c("Good: Pct Lat", "Good: Pct Asian", "Good: Pct Wht")
good_corona <- goodman_generalize(cands, race_group3, "totvote", corona, table_names)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.