Hi! I'm doing a proc autoreg statement and I want to access the T-Value of my first variable. I'm performing the Regression on every month in the dataset (hpid is the id of the first month). Using the outest statement I can get my variable log_hv_iv_diff for every month into one dataset, but I cant figure out how to access the associated T-Value. It would be the best if I could write teh T-Value into the same dataset. Can anyone help? Thanks!
Code:
proc sort data=vola_deciles out=pre_processed_data;
by hpid cp_flag;
run;
proc autoreg data=pre_processed_data plots=none outest=results_reg NOPRINT;
model &return=log_hv_iv_diff / covest=neweywest;
by hpid cp_flag;
run;
proc delete data=pre_processed_data;
run;
ods trace on;
proc autoreg data=pre_processed_data plots=none outest=results_reg NOPRINT;
model &return=log_hv_iv_diff / covest=neweywest;
by hpid cp_flag;
run;
ods trace off;
This will write to your LOG the actual name of the output you want. (If I could read German, I could probably figure it out from the SAS documentation).
Once you have that actual name, you can then do the following
proc autoreg data=pre_processed_data plots=none outest=results_reg NOPRINT;
ods output actualname = somedatasetname;
model &return=log_hv_iv_diff / covest=neweywest;
by hpid cp_flag;
run;
ods trace on;
proc autoreg data=pre_processed_data plots=none outest=results_reg NOPRINT;
model &return=log_hv_iv_diff / covest=neweywest;
by hpid cp_flag;
run;
ods trace off;
This will write to your LOG the actual name of the output you want. (If I could read German, I could probably figure it out from the SAS documentation).
Once you have that actual name, you can then do the following
proc autoreg data=pre_processed_data plots=none outest=results_reg NOPRINT;
ods output actualname = somedatasetname;
model &return=log_hv_iv_diff / covest=neweywest;
by hpid cp_flag;
run;
See the explanation and examples at "ODS OUTPUT: Store any statistic created by any SAS procedure."
Thanks to PaigeMiller and Rick_SAS! Both of your answers really helped and it didn't take me long to finish the task!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.