* Heteroskedasticity in OLS Model for Mutual Funds' Returns
*
* Keywords:
* regression, ols, linear, heteroskedasticity, rank, test, srcc, mutual fund,
* returns
*
* Description:
* We illustrate how to estimate a linear OLS Model for Mutual Funds' Returns
* and use Rank Correlation Heteroskedasticity Test
*
* Author(s):
* Skif Pankov
*
* Source:
* Damodar N. Gujarati and Dawn C. Porter, Basic Econometrics - 5th Edition
* McGraw-Hill International Edition, Chapter 11, Example 11.3 (page 381)
*
sample 1 10
* Reading the datafile and naming variables
read(data_11.3.shd) ret sd
* Running an OLS regression of ret on sd, stating to include residual
* statistics and to save residuals in a variable reds
ols ret sd / rstat resid = reds
* Saving degrees of freedom of the regression as num
gen1 num = $n - 2
* Generating absolute values of residuals
genr u = abs(reds)
* Calculating Spearman's Rank Correlation Coefficients
stat sd u / prankcor rankcor = src
* Saving the SRCC of sd and u as r
gen1 r = src:2
* Generating the test statistic tst
gen1 tst = r*sqrt(num)/sqrt(1-r**2 )
* Computing tst's probability using a t distribution
distrib tst / type = t df = num
stop