Astarte - 6 months ago 35

R Question

I am using mhurdle package in order to estimate a truncated normal hurdle model. The function mhurdle includes a "weight" argument that is supposed to work in the same way as in lm (according to the help for mhurdle). When I use this argument, though, I obtain exactly the same results as in the case without weights.

I wonder why this could be and also, as an alternative, if it would be possible to modify the variables in order to include weights before estimating the model (the package uses maximum likelihood estimation).

(I read on a forum once of another function that resulted in the same problem because the weights were never actually used in the estimation. It could be the same here but I don't know how to check and I have not been able to find that question again)

This is how I wrote the call to the function:

`depvar <- mhurdle (y ~ indvar1 + indvar2 + indvar3 |`

indvar1 + indvar2 + indvar3 |

0,

data = mydata,

na.action = na.omit,

dist = "tn",

weights = mydata$weights)

Any ideas/suggestions?

Thanks

Answer

This is a CRAN package. Reach out to the authors if the package isn't working as advertised. https://cran.r-project.org/web/packages/mhurdle/index.html

Source (Stackoverflow)