eiCompare (version 3.0.0)

goodman_generalize: Goodman Regression Generalization

Description

Makes summary table out of multiple heckman regression results, for multiple candidates and groups

Usage

goodman_generalize(cand_vector, race_group, total, data, table_names, ...)

Arguments

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

Value

Object of class data.frame() returned containing table summary of all the Goodman regressions

References

eiPack King et. al. (http://gking.harvard.edu/eiR) L. A. Goodman. Ecological regressions and behavior of individuals. American Sociological Review, 1953.

See Also

ei_rc_good_table

Examples

Run this code
# NOT RUN {
# Load corona data
# }
# NOT RUN {
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)
# }

Run the code above in your browser using DataCamp Workspace