Nick
Nick

Reputation: 11

plotting hurdle regression output

I am attempting to plot hurdle regression output with an interaction term in r, but am having some trouble doing so with the count portion of the model.

Model <- hurdle(Suicide. ~ Age + gender + bullying*support, dist = "negbin", link = "logit")

Since I am unaware of any approaches that would allow me to plot these data without estimating each portion separately (binomial logit and negative binomial count), I am attempting to plot each using estimates using the MASS package. So far, I have had the best luck using the visreg package for plotting, but am open to other suggestions. I have been able to reproduce and successfully plot the original logistic output from the hurdle model, but not the negative binomial count data (i.e., the parameter estimates from MASS are not the same as they are in the hurdle regression output).

I would greatly appreciate any insight regarding how others have plotted hurdle regression results in the past, or how I might be able to reproduce negative binomial coefficients originally obtained from the hurdle model using glm.nb in MASS.

Here is what I am using to plot my data:

##Logistic 

logistic<-glm(SuicideBinary ~ Age + gender + bullying*support, data = sx, family="binomial")

data("sx", package = "MASS")
##Linear scale
visreg(logistic, "bullying", by="support", xlab = "bullying", ylab = "Log odds (Suicide yes/no)")

##Logistic/probability scale
visreg(logistic, "bullying", by="support", scale = "response", xlab = "bullying", ylab = "P(Initial Attempt)")

##Count model

NegBin<-glm.nb(Suicide. ~ Age + gender + bullying*support, data = sx)

data("sx", package = "MASS")
##Linear scale
visreg(NegBin, "bullying", by="support", xlab = "bullying", ylab = "Count model (number of suicide attempts)")

##Logistic/probability scale
visreg(NegBin, "bullying", by="support", scale = "response", xlab = "bullying", ylab = "P(Subsequent Attempts)")

Upvotes: 1

Views: 895

Answers (0)

Related Questions