Hi, i believe that the solution of my problem could help many of the stata users.
I have one dependent variable A, 100 independent variables B1, B2....B20 and 10 control variables C1, C2....C10. Please note that the name of independent and control variables is in random form and not in any order.
First, i wants a looping regression, where, in each single regression equation I want to use same dependent variable and same control variables (C1 to C10), but 100 independent variables individually one by one in each regression equation (total 100 regression equations).
Second, i need to save the coefficients (t-statistic and p-value) for only the independent variables from each regression equation in any of the output format (word excel). May be using outreg2, but not sure.
Third, (similar to first), want to run again a looping regression where same dependent variable, same control variables but here each regression equation should include 5 independent variables instead of one independent variable in each regression. Like, first regression includes first 5 independent variables and then second regression equation includes second 5 independent variables, with no change in dependent and control variables. Finally, save the coefficients for the independent variables in any output format.
Thanks for the help.
I have one dependent variable A, 100 independent variables B1, B2....B20 and 10 control variables C1, C2....C10. Please note that the name of independent and control variables is in random form and not in any order.
First, i wants a looping regression, where, in each single regression equation I want to use same dependent variable and same control variables (C1 to C10), but 100 independent variables individually one by one in each regression equation (total 100 regression equations).
Second, i need to save the coefficients (t-statistic and p-value) for only the independent variables from each regression equation in any of the output format (word excel). May be using outreg2, but not sure.
Third, (similar to first), want to run again a looping regression where same dependent variable, same control variables but here each regression equation should include 5 independent variables instead of one independent variable in each regression. Like, first regression includes first 5 independent variables and then second regression equation includes second 5 independent variables, with no change in dependent and control variables. Finally, save the coefficients for the independent variables in any output format.
Thanks for the help.
Comment