BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MAC1430
Pyrite | Level 9

Dear all,

 

Could you please advise me if there is a way to estimate t-stats for portfolio returns using White’s heteroskedasticity-adjusted standard errors, especially in proc means.

 

Thansk in advancefor your help.

 

Best Regards,

 

Cheema 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

I can answer the second part of your question: convert the data from wide form to long form and then use BY-group processing to process all the variables with one procedure call. For your example that has two variables:

 


data stack;
set have(keep=date port1 rename=(port1=port))
    have(keep=date port2 rename=(port2=port) in=g);
group = g+1;
run;

ods graphics off;
proc model data=stack;
   by group;
   endo port ;
   instruments / intonly;
         port=b0;
   fit port / gmm kernel=(bart, 1, 0);
   run; 
quit;

View solution in original post

3 REPLIES 3
Rick_SAS
SAS Super FREQ

We'll need more details (structure of data?) to offer anything concrete.  I think these estimates are also called "sandwich estimates" (?). They aren't part of PROC MEANS but you can get them in SAS/STAT procedures such as GENMOD. 

MAC1430
Pyrite | Level 9

Hi Rick,

 

Thanks for your response. Please find the data given below, basically its its average monthly returns of two portfolios (time-series). In the past, I used to estimate Newey West t-statistics and found online that t-stat using White’s heteroskedasticity-adjusted standard error is similar, but not sure since it provided me the same answer like simple t-stat. Furthermore, is it possible to code it in a way that I can get White’s heteroskedasticity-adjusted for both the portfolios at once instead of running the model for each portfolio seperately?

data have;
infile cards expandtabs truncover;
input date : yymmn6. port1 port2 ;
format date yymmn6.;
cards;
199501	-12.8774	-15.9533
199502	2.3605	1.2441
199503	11.3115	3.8817
199504	-7.5567	-6.0238
199505	4.861	1.463
199506	-8.4025	-5.5822
199507	7.877	10.0285
199507	3.8999	2.2173
199508	2.8722	5.5666
199508	4.7494	2.9481
199509	-0.1961	-0.967
199509	-0.906	-3.0715
199510	2.2826	1.3475
199510	1.2008	1.9409
199511	-7.8011	-7.7997
199511	-5.1886	-3.1171
199512	-12.0533	-12.5316
199512	-6.8809	-9.8692
199601	-2.6321	-3.3365
199601	-4.6634	-4.5228
199602	3.352	3.9263
199602	3.082	2.4645
199603	0.1532	2.1435
199603	-1.9428	0.0755
199604	27.5239	25.988
199604	34.4729	42.8569
199605	-5.9426	-9.9524
199605	1.3499	-0.6048
199606	21.3006	15.486
199606	18.1896	13.6956
199607	5.852	5.1746
199607	33.8655	42.5136
199608	-3.3695	0.6106
199608	5.7739	-1.5214
199609	5.857	5.1485
199609	6.3112	0.6669
199610	12.395	7.9307
199610	42.0208	51.5401
199611	5.7496	6.882
199611	15.4236	10.3373
199612	-12.608	-10.3824
199612	-21.5054	-29.4552
run;
**** proc means for simple t-stat; 
proc means data=have n mean t probt maxdec=5;
var port1 port2;
run;
**** proc model for White's heteroskedasticity adjusted t-stat of Port1; 

proc model data=have;ods graphics off;
         endo port1 ;
         instruments / intonly;
         		port1=b0;
         fit port1 / gmm kernel=(bart, 1, 0);
         run; 
         quit;
		**** proc model for White's heteroskedasticity adjusted t-stat of Port2; 

proc model data=have;ods graphics off;
         endo port2 ;
         instruments / intonly;
         		port2=b0;
         fit port2 / gmm kernel=(bart, 1, 0);
         run; 
         quit;

 Thanks for your help.

 

Regards,

 

Cheema 

Rick_SAS
SAS Super FREQ

I can answer the second part of your question: convert the data from wide form to long form and then use BY-group processing to process all the variables with one procedure call. For your example that has two variables:

 


data stack;
set have(keep=date port1 rename=(port1=port))
    have(keep=date port2 rename=(port2=port) in=g);
group = g+1;
run;

ods graphics off;
proc model data=stack;
   by group;
   endo port ;
   instruments / intonly;
         port=b0;
   fit port / gmm kernel=(bart, 1, 0);
   run; 
quit;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1010 views
  • 1 like
  • 2 in conversation