08-19-2014 02:35 PM
I am running a set of multiple regressions using a difference-in-difference model in a loop. I would like to extract the p-value (Pr > |t|) for a particular independent variable after each regression and store it in another SAS dataset. Is there a specific command that would help me derive the p-value for a particular independent variable?
08-19-2014 02:53 PM
Most (all?) SAS regression procedures produce a ParameterEstimates ODS table. The most straightforward way to get all estimates and p-values in a single dataset is to organize your set of analysis data into a single dataset and to call your regression procedure with BY processing. That way, all your estimates end up directly into the same dataset. If that isn't possible, you will have to do some post-processing to combine multiple ODS output datasets into one.
PG
08-19-2014 03:29 PM
This would be a combination of ods and proc append in a loop.
ods output ParameterEstimates= ParameterEstimates;
proc reg data=have;
model Y=X1 X2;
quit;
proc append base=p_value data=ParameterEstimates(keep=variable probt);
where variable='X1';
run;
proc print data= p_value;
run;