R/optimal_behavior.R
optimal_behavior.Rd
Calculate the Optimal Behavior for the Actor following an Event
optimal_behavior(
d,
equation_key = NULL,
equation_gender = NULL,
eq_df = NULL,
...
)
data that has been reshaped by the reshape_events_df function
a string corresponding to the equation key from actdata
either average, male, or female, depending on if you are using gendered equations
3 digit EPA indicating the optimal behavior
opt_behavior_example <- tibble::tibble(actor = "teenager", behavior = "beam_at",object = "friend")
opt_behavior_df <- reshape_events_df(df = opt_behavior_example, df_format = "wide", dictionary_key = "indiana2003", dictionary_gender = "male")
#> Joining, by = c("term", "component")
opt_b <- optimal_behavior(d = opt_behavior_df, equation_key = "nc1978", equation_gender = "male")
#> Adding missing grouping variables: `event_id`