Closed LAStarcevich closed 6 years ago
Thank for reporting. It was a bug in the effectPlotData()
function for models with an extra zero part. It should work now.
Regarding the second question, indeed the predict()
method with type_pred="response"
returns the predictions on the response scale, which in the case it will be (1 - pi) * mu_nz, where pi denotes the probability of an (extra) zero, and mu_nz denotes the mean of the non-zero part.
Works like a charm -- thanks for the update and background.
I have developed a lognormal hurdle model (m) and have a fake dataframe (fakeDF) that contains median values for all but one model covariate to obtain marginal effects plots. I am unable to use the effectPlotData(m,fakeDF) call. I get the following error:
Error in match.arg(sub_model) : 'arg' should be one of “main”, “zero_part”
When I use predict(m, fakeDF,type_pred="response",type ="mean_subject"), I get different predictions as compared to exp(fakeDF %*% beta).
Can you provide any guidance? Thanks -- Leigh Ann Starcevich