I am using poisson regression model with global macro. It works fine, but the final outcome is a coefficient not irr. Can anyone please help?
Please ignore what the following model is trying to calculate. This is just for reference:
Also, I just realised the code with macro does not work if the regression model is not run separately without a macro:
The following code does not work, as I won't be running the poison model without macro
Please ignore what the following model is trying to calculate. This is just for reference:
Code:
sysuse auto, clear rename price population generate logpop = ln(population) encode make, generate(make1) poisson mpg i.foreign c.length rep78, offset(logpop) irr // here the result is in irr global model1 = "`mpg i.foreign c.length rep78, offset(logpop) irr'" poisson $model1 // here the result is in Coef
Also, I just realised the code with macro does not work if the regression model is not run separately without a macro:
The following code does not work, as I won't be running the poison model without macro
Code:
sysuse auto, clear
rename price population
generate logpop = ln(population)
encode make, generate(make1)
//poisson mpg i.foreign c.length rep78, offset(logpop) irr // here the result is in irr
global model1 = "`mpg i.foreign c.length rep78, offset(logpop) irr'"
poisson $model1 // here the result is in Coef
Comment