powered by
This function returns a data frame with interactive margins and standard errors similar to those returned in the STATA margins call. The function can also return a margins plot.
stata.plm.margins(mod, plot = FALSE, error = NULL)
This function creates a data frame of predictive margins for the dependent variable, given values of the variables in the interaction.
a plm model object.
logical (default set to FALSE). When set to plot = TRUE, will return a an margins plot of the interaction terms.
FALSE
plot = TRUE
the number standard deviation units for which the margins will be calculated (default set to 2).
library(plm) data <- UCR2015 summary(mod <- plm(dui_pct ~ pct_poverty*pct_unemp + income_inequality, data=data, index=c("state","county"), model="within")) stata.plm.margins(mod)
Run the code above in your browser using DataLab