Hello all, I am running a fix-effect model and I'd like to predict dependent variable at various level of mortality and in particular proportionate levels of the mortality.
the code are as follows:
xtset id year
xtreg lgdp lgphysicapital TFP DalysIDA edu_aug_labor2554 edu_aug_labor5564 institutionalquality wfpop,fe cluster(id)
Among them, DALY is a health variable that refers to mortality. I tried margins command to construct a scenario of GDP change by using GDP with a constant mortality rate minus GDP when the mortality rate is reduced to 95%.
margins, at(DalysIDA = gen(DalysIDA))
scalar mean_original = r(b)[1,1]
margins, at(DalysIDA = gen(DalysIDA*0.95))
scalar mean_reduced = r(b)[1,1]
scalar mean_difference = mean_reduced - mean_original
display "The average predicted value of GDP in the original Daly's IDA: " mean_original
display "The predicted average GDP value after reducing Daly's IDA by 5%: " mean_reduced
display "Change in the average predicted value: " mean_difference
However, there are some issues, such as only being able to predict a mean value for the entire model, rather than predicting a value for all observations. Secondly, the predicted value, i.e., GDP, is very small, only $1
Therefore, any suggestions on how to improve the prediction method would be greatly appreciated.
the code are as follows:
xtset id year
xtreg lgdp lgphysicapital TFP DalysIDA edu_aug_labor2554 edu_aug_labor5564 institutionalquality wfpop,fe cluster(id)
Among them, DALY is a health variable that refers to mortality. I tried margins command to construct a scenario of GDP change by using GDP with a constant mortality rate minus GDP when the mortality rate is reduced to 95%.
margins, at(DalysIDA = gen(DalysIDA))
scalar mean_original = r(b)[1,1]
margins, at(DalysIDA = gen(DalysIDA*0.95))
scalar mean_reduced = r(b)[1,1]
scalar mean_difference = mean_reduced - mean_original
display "The average predicted value of GDP in the original Daly's IDA: " mean_original
display "The predicted average GDP value after reducing Daly's IDA by 5%: " mean_reduced
display "Change in the average predicted value: " mean_difference
However, there are some issues, such as only being able to predict a mean value for the entire model, rather than predicting a value for all observations. Secondly, the predicted value, i.e., GDP, is very small, only $1
Therefore, any suggestions on how to improve the prediction method would be greatly appreciated.
Comment