goodman_generalize: Goodman Regression Generalization

View source: R/goodman_generalize.R

goodman_generalizeR Documentation

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

Author(s)

Loren Collingwood <loren.collingwood@ucr.edu>

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


# 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)

## End(Not run)

eiCompare documentation built on Aug. 31, 2023, 5:16 p.m.