Dear all,
I am using confidential data therefore I replicated an example after reading the FAQ.
I first searched solutions but couldn't find anything. I'm trying to model health costs and thanks to papers like Pr. Andrew M. Jones - "Models For Health Care" (https://www.york.ac.uk/media/economi...c/wp/10_01.pdf) I realized I should try different models and test them.
I used these models
with the costs that I "logged" to try getting a normal distribution.
I used a Poisson regression
but also
hoping I could solve my issues as they return the same results but have different options.
I also used a
I got results for these models and that's where my question comes, I can't manage to compare them using tests like RESET test, or comparing RMSE (like mentioned in the article I cited earlier)
My code example:
I get a result for the RESET test or the RMSE when I use “regress” but I can't get them for the glm commands…
How to compute RESET tests for my glm or how can I compare my errors ? (If I can compare my errors, I would choose the model that has the best predictions of my costs)
But when I use the following, I can't use the
command
or
All these codes give me error "option residuals not allowed".
I saw on an other post the possiblity to use:
I don't get the difference between using "res" and not "residuals" ... It seems like the same option, but one works and not the other ?
I read on that post that comparing errors for Poisson is hard... I used the
but It didn't help me understand.
Do you have a solution?
Thank you very much for the time you take on forums!
Alejandro
I am using confidential data therefore I replicated an example after reading the FAQ.
I first searched solutions but couldn't find anything. I'm trying to model health costs and thanks to papers like Pr. Andrew M. Jones - "Models For Health Care" (https://www.york.ac.uk/media/economi...c/wp/10_01.pdf) I realized I should try different models and test them.
I used these models
Code:
regress ln_costs covariates, robust
I used a Poisson regression
Code:
poisson costs covariates, vce(robust) irr (
Code:
glm costs covariates, vce(robust) eform family(poisson) link(log)
I also used a
Code:
glm costs covariates, family(gamma) link(log) vce(robust) eform
My code example:
Code:
sysuse auto.dta, clear gen ln_price = ln(price) reg ln_price mpg weight rep78, robust ovtest di e(rmse) glm price mpg weight rep78, family(gamma) link(log) robust eform ovtest ereturn list
How to compute RESET tests for my glm or how can I compare my errors ? (If I can compare my errors, I would choose the model that has the best predictions of my costs)
But when I use the following, I can't use the
Code:
predict, residuals
Code:
glm costs covariates, family(poisson) link(log) vce(robust) eform predict newvar, residuals
Code:
poisson costs covariates, vce(robust) irr predict newvar, residuals
I saw on an other post the possiblity to use:
Code:
glm costs covariates, family(poisson) link(log) vce(robust) eform predict newvar, res
I read on that post that comparing errors for Poisson is hard... I used the
Code:
help glm_postestimation
Do you have a solution?
Thank you very much for the time you take on forums!
Alejandro
Comment