Hi everyone,

I'm trying to a run a simple regression with five variables of interest. The primary interest is a dummy variable created using the average of another variable. What I want to do is to check if the result is 'robust'.

So let's say the regression I am running is: y = B0 + B1X1 + B2X2 + B3X3 + B4X4 + B5X5 + error. X2 is the variable that is the dummy variable based on another variable, Z. What I want to do is to run regressions in which X2 takes every value (average of Z) +/- x (some small number). Hence, I want to check is B2 is still significant if the value of X2 differs somewhat.

To do this, I'm thinking of running a loop and saving the p value of each regression in a matrix. Then I can just look at the matrix and if most of the step is greater than 0.05, then I know that the result I got was a fluke.

Does this make sense? How would I be able to get the p-value post command and save one by one in a loop in a matrix?

Thank you so much!