Storing p-values from regression outputs

Reply
N/A
Posts: 1

Storing p-values from regression outputs

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?

Respected Advisor
Posts: 4,609

Re: Storing p-values from regression outputs

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

PG
Trusted Advisor
Posts: 1,203

Re: Storing p-values from regression outputs

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;

Ask a Question
Discussion stats
  • 2 replies
  • 681 views
  • 8 likes
  • 3 in conversation