Programming the statistical procedures from SAS

Help with 3 tests

Reply
Occasional Contributor
Posts: 11

Help with 3 tests

Hi all,

My data currently look like this:

Time To Maturity          Volatility

     1                                   0.65

     2                                   0.21

     3                                   0.33

I am looking to run the following three tests on my data and want to make sure I am doing so correctly.

1.Jonckheere-Terpstra test

     To examine if the volatility increases as a contract approaches maturity

2.Newy West Heteroskedasticity Consistent Covariance Procedure

     To regress the daily future realised volatility on a constant and the number of days until the contract matures.

3.GARCH (1, 1) model

I want to make sure I am coding this correctly in order to ascertain that the results are correct.

Any assistance will be greatly appreciated.

Community Manager
Posts: 2,634

Re: Help with 3 tests

Moved this to so that the experts will see it.

Chris

Respected Advisor
Posts: 2,655

Re: Help with 3 tests

The JT test is dependent on discordant observations for ordinal categories, so it will definitely need more observations than the 3 mentioned (I assume that is a sample, and not the whole dataset).  PROC FREQ offers the JT test, including an exact test.

Newey-West and GARCH models are implemented in the SAS/ETS package.  The good folks in the Forecasting and Econometrics forum will have a much better chance of being to answer your questions about which PROCs to implement to meet your goals

Steve Denham.

Occasional Contributor
Posts: 11

Re: Help with 3 tests

Hi Steve,

Thanks so much for your response. Yes- that is just a sample.. Do you know the exact syntax for the proc freq test?

Regards,

Terri

     

Respected Advisor
Posts: 2,655

Re: Help with 3 tests

Hi Terri,

To make a JT test work, you'll probably need to code volatility into some sort of ordinal variable.  Deciles would make sense.  Also, I am assuming time to maturity doesn't take on too many values, or it too would have to be coded.  Once that is done, you could then run:

proc freq data=yourcodeddata;

tables time*volatility_decile/jt;

run;

If there are not too many levels of the two variables, you could get an exact test with:

proc freq data=yourcodeddata;

tables time*volatility;

exact jt;  /* You could add the mc option after a slash here to get a Monte Carlo simulation, if execution time seems inordinate  */

run;

Steve Denham

Message was edited by: Steve Denham

Occasional Contributor
Posts: 11

Re: Help with 3 tests

Thanks Steve - that works perfectly. Smiley Happy

For the second test i.e. the Newy West Heteroskedasticity Consistent Covariance Procedure  where by I need to regress the daily future realised volatility on a constant and the number of days until the contract matures do you know how I would do this?

Kind regards,

Terri


Respected Advisor
Posts: 2,655

Re: Help with 3 tests

Definitely outside my usual work, but a search of the documentation points to PROC AUTOREG or PROC MODEL in SAS/ETS.  At this point, your best bet would be to ask the Forecasting and Econometrics forum for help.

Steve Denham

Ask a Question
Discussion stats
  • 6 replies
  • 346 views
  • 1 like
  • 3 in conversation