r - plotting hurdle regression output -
i attempting plot hurdle regression output interaction term in r, having trouble doing count portion of model.
model <- hurdle(suicide. ~ age + gender + bullying*support, dist = "negbin", link = "logit")
since unaware of approaches allow me plot these data without estimating each portion separately (binomial logit , negative binomial count), attempting plot each using estimates using mass package. far, have had best luck using visreg package plotting, open other suggestions. have been able reproduce , plot original logistic output hurdle model, not negative binomial count data (i.e., parameter estimates mass not same in hurdle regression output).
i appreciate insight regarding how others have plotted hurdle regression results in past, or how might able reproduce negative binomial coefficients obtained hurdle model using glm.nb in mass.
here using plot 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)")
Comments
Post a Comment