CPHS utilities
Karmana.get_HR_number
— Functionget_HR_number(hr::Union{String, Missing})::Union{Int, Missing}
Extracts the number from a string of a form "HR ???"
and returns it. If the input is missing
, then missing
is returned.
Karmana.get_sentiment_props
— Functionget_sentiment_props(df, sentiment_key; good = "Good times", bad = "Bad times", uncertain = "Uncertain times")
Takes in a DataFrame from the CPHS aspirational wave database, and returns a tuple of (bad_prop, good_prop, uncertain_prop)
.
The keys can be changed by keyword arguments; fundamentally, this is a helper function to extract proportions from a three-value system.