0
votes

Is there an R equivalent of the Stata package Grinter? I would like to graph an interaction effect from a logistic regression equation in R, and I can't seem to get any of my graphs to work. If there were a command in R that could do what Grinter does in Stata, that would be extremely helpful.

Here's my equation:

svyglm(onset.new~Gini+preci.ma.30.CRU+lag.polity+
pop.growth+lpop+lag.lGDP.pc+Oil+ethfrac+lmtnest+Gini*preci.ma.30.CRU,
design=NEWD,na.action=na.omit,family=quasibinomial)

I'm interested in graphing the interaction term Gini*preci.ma.30.CRU (inequality times precipitation change) to see how the two variables combined affect conflict onset (onset.new). All the other variables are just controls.

Thank you!

1
There are many ways to graph interaction effects but to provide a worked example we need data, and all I see is code that is clearly dependent on a lot of prior work with the (unacknowledged) survey package. - IRTFM

1 Answers

0
votes

You can use the regression equation to calculate the predicted onset.new for the levels of Gini and precipitation you are intersted in (low/high Gini and low/high precipitation). You can then create a dataset with these predicted values and plot it as a bar or line graph. The dataset would look like this:

predicted.onset.new Gini precipitation .34 low low .23 high low .81 low high .28 high high