# Implementation of Shanken (1992) Adjustement for Fama MacBeth Asset Pricing Tests

I am trying to implement an unconditional asset pricing test according to the Fama & MacBeth (1973) method. The calculation of the factor-loadings as average of monthly cross-sectional regressions are all set and working. A challenge I am facing is the implementation of a proper t-Stat. Originally I just the calculation based on Cochrane (2005): $$\sigma^2(\lambda)=1/T^2*\sum \limits_{t=1}^T (\hat\lambda_t-\bar\lambda)^2$$ This value I used in the t-Test: $$tStat=\frac{\bar\lambda-0}{\sqrt{\sigma^2}}$$

As this calculation of the t-Stat does not contain a correction for the error in variables problem I looked for a Shanken (1992) adjustment on the standard error. Unfortunately many papers state, that they apply the Shanken adjustments to their t-Stats but do not include a calculation for it. I found a description for the implementation of a Shanken-adjustment (http://lipas.uwasa.fi/~sjp/Teaching/eaptx/lectures/p5.pdf - slide 41 and following). This example also includes a sample implementation of the Shanken-adjustment in Stata for a single cross-sectional regression. I used this example and transferred the calculations into Matlab-code.

The problem now is that I am uncertain how the aggregation of periodic standard error calculations (following the Shanken-adjustments) into one standard error for the t-test happens. With a single cross-section regression there is no aggregation of values - but for the periodical cross-section regression according to Fama & MacBeth I run monthly cross-sectional regressions. I implemented "my interpretation" of a Shanken-adjustment in a 60 month rolling regression to reconcile the results of Artmann (2011: https://www.econstor.eu/bitstream/10419/70130/1/736358048.pdf page 36, table 8, panel F) who implemented a Shanken t-stat with Fama & MacBeth implementation. I can reconcile the paper's factor loadings approximately but the calculated t-stats a far off.

Whereas the paper arrives at a t-stat of 3.6 for the intercept my t-stat is only 1.28. Hence I assume my implementation of the Shanken-adjustment for the rolling beta estimation Fama/Macbeth procedure is faulty. My code works as follows:

% general calculation:
varianceOfDependent = cov(testAssetReturnData) ./ estimationPeriod;
factorCovariance = cov(factorData);

% ########################################################
% calculation for each cross-section regression:
% 1) variance calculation:
variance = (X'*X)^-1 * X' * varianceOfDependent * X * (X'*X)^-1; % variance estimate according to Cochrane, with X as Nxk matrix

% 2) calculate correctional factors
c =  regResult.beta(2:end) * factorCovariance^-1 * regResult.beta(2:end)'; % with regResult.beta(2:end) corresponding to the coefficient estimates for all factors (no intercept!)
modifiedFactorCovariance = [zeros(1,size(factorCovariance,2)+1);

zeros(size(factorCovariance,2),1) factorCovariance];
standardErrorsShanken = diag(sqrt(variance*(1+c) + modifiedFactorCovariance ./estimationPeriod))';
tStatShanken = transpose(regResult.beta) ./ standardErrorsShanken; % transpose(regResult.beta) as lambda estimates of the period

% ########################################################
% Each tStatShanken is stored and the average is taken for each factor to arrive at the t-stat results


The implementation follows equation 41 of the linked paper:

Do you know how to properly implement the Shanken-adjustments for the Fama/MacBeth approach? Many thanks!

I think I got the answer of how to implement the adjustment:

Based on the variance of lambdas for the Fama/MacBeth calculation $$\sigma_{OLS}^2(\lambda)=1/T^2*\sum \limits_{t=1}^T (\hat\lambda_t-\bar\lambda)^2$$

I implemented the following adjustment: $$\sigma_{Shanken}^2(\lambda)=\sigma_{OLS}^2(\lambda) * (1+c) + \frac{\tilde{\sum_F}}{T}$$ with: $$c = \hat{\lambda} * cov(factors)^{-1}* \hat{\lambda}'$$ where:

• $$cov(factors)$$ is the variance-covariance matrix of assessed factors (which is an Nxk matrix for k-factors)
• $$\hat{\lambda}$$ is the lambda estimate vector resulting from the mean of periodic cross-sectional regression
• $$\tilde{\sum_F}$$ is the adjusted variance-covariance matrix from above with zeros in the first row and first column and the variance-covariance matrix in the right-bottom corner

When calculating a rolling-regression for the beta estimate the Shanken adjustments changes to c*: $$c^*=c*(1-\frac{1.6}{n})$$ with n as number of years in sample

!!! Please note that the adjustment factors changes if beta-estimation period deviates from a 60 month rolling beta approach !!!

Regards, Stonehenge

• Cool, thanks for sharing your solution! – Richard Hardy Jun 11 at 9:57