Dear Statalisters,
I am struggling with a task in which I want to investigate how an additional variable (i.e., human rights) affects my regression results.
My regression model is as follows:
where DV represents dependent variable; IV represents independent variables. Human rights is my key explanatory variable and I am interested in looking at how human rights affects the explanation of my results.
Task:
1. Generate a set of predictions for a model in which I use all the explanatory variables except human rights with the coefficients estimated over the whole sample.
2. Compare these predictions with the regressions fitted values (which take into account all the predictors including human rights)
3. Calculate the % difference between the first two measures to see how much of the dependent variable is explained by the human rights.
Now, I am struggling with the second and third step in Stata. I am also wondering whether my codes for the first two steps are okay.
Any help will be appreciated.
Best regards,
Shazmeen Maroof.
I am struggling with a task in which I want to investigate how an additional variable (i.e., human rights) affects my regression results.
My regression model is as follows:
Code:
regress DV IV HR
Task:
1. Generate a set of predictions for a model in which I use all the explanatory variables except human rights with the coefficients estimated over the whole sample.
Code:
regress DV IV
Code:
predict foreignaid
Code:
regress DV IV HR
3. Calculate the % difference between the first two measures to see how much of the dependent variable is explained by the human rights.
Now, I am struggling with the second and third step in Stata. I am also wondering whether my codes for the first two steps are okay.
Any help will be appreciated.
Best regards,
Shazmeen Maroof.
Comment