
Calculate partial effects based on a model with interactions
Source:R/interactions.R
tl_interaction_effects.RdCalculate partial effects based on a model with interactions
Value
For numeric var: a list with effects (data frame of
predicted values across the variable range for each level of
by_var) and slopes (data frame with the slope of
var at each level of by_var). For categorical
var: a data frame of predicted values at each factor level for
each level of by_var.
slopes$slope_se is the standard error of a straight line fitted
to the prediction grid, not the sampling uncertainty of the marginal
effect. For a linear model the grid is exactly linear in var,
so this is near zero by construction and should not be read as a
precise estimate. Use summary(model$fit) for inference on the
interaction coefficient itself.