{smcl}
{* 29April2014}{...}

{hline}
help for {hi:grstest}
{hline}
  
{title:grstest - module to implement the Gibbons et al. (1989) test in a single factor or a multi factor setting}

{title:Syntax :} 

{cmd:grstest} {it:varlist}{cmd:,flist(factorlist)} {cmd:[ret(string)]}

{title:Description :}

{title:multi factor setting}

{cmd:grstest} implements the test by Gibbons et al.(1989) within a multi factor setting when the  
the number of factors in {cmd:flist is greater than 1}. Here, {cmd:grstest} computes the grs test statistic as 

GRS = ((`T'-`N'-`K')/(`N')) * w ~ F(df1,df2)

where w =  (bohat' * sigmahat^-1 * bohat) / (1 + fbar' * omegahat^-1 * fbar)

and,

T = total number of observations
N = Number of portfolios or assets
K = Number of factors in the flist 
fbar= column vector of the factor means (K*1)
omegahat = variance-covariance matrix of the factors (K*K)
bohat = column vector of intercept estimates (N *1)
sigmahat = the residual variance-covariance matrix (N *N)
df1 = N
df2 = T-N-K

{title:single factor setting}

{cmd:grstest} implements the test by Gibbons et al.(1989) within a single factor setting when the  
the number of factors in {cmd:flist is equal to 1}. Here, {cmd:grstest} computes the grs test statistic as 

GRS = ((`T'-`N'-`K')/(`N')) * w ~ F(df1,df2)

where w =  (bohat' * sigmahat^-1 * bohat) / (1+ thetahat^2)

and,

T = total number of observations
N = Number of portfolios or assets
K = 1 
thetahat= sample mean of the factor / sample standard deviation of the factor.
bohat = column vector of intercept estimates (N *1)
sigmahat = the  residual variance-covariance matrix (N *N)
df1 = N
df2 = T-N-1

{title:Example Usage:}

{p 5 5}{inp:. grstest p*, flist(rmrf smb hml) ret(r)}{p_end}

{p 5 5}{inp:. grstest p*, flist(f*) ret(r)}{p_end}

{p 5 5}{inp:. grstest s*b*_vwr, flist(mktrf smb hml)}{p_end}

{p 5 5}{inp:. grstest s*b*_vwr, flist(mktrf)}{p_end}


{title: Options}

flist (factorlist) : specifies the factors.  It is a required option.

ret (string): this must be specified as ret(r) if the returns are raw returns. If it is not specified or incorrectly 
specified with anything other than r, the program will assume that the returns are excess returns. It is not a required 
option.

{title:Notes:}

1. {cmd:grstest} requires that data be in the wide format i.e with each portfolio return and factor in a separate variable.

2. {cmd:grstest} requires that the option ret(r) is to be specified if the portfolio/asset returns are raw returns.
   If ret(r) is specified, the excess returns will be computed automatically.However, if  ret(r) is specified, 
   {cmd:grstest} requires that a variable rf containing  the relevant risk free rate is  present to calculate the excess 
   returns. Specifying ret(r) without a rf variable will result in an error. If the option ret() is not specified or  
   incorrectly specified then {cmd:grstest} will display the message "The option ret() is not specified or specified 
   properly.{cmd:grstest} will assume that the returns are excess returns" and run the test assuming that the returns are 
   excess returns.
      
{title:Author:}

{p 5 5}
Rajesh Tharyan{break}
Xfi- Centre for Finance and Investment{break}
University of Exeter{break}
r.tharyan@ex.ac.uk 
{p_end}

{title:References:}

Fama, E.F. & French, K.R., 1993. Common risk factors in the returns on stocks and bonds. Journal of Financial Economics, 33(1), 3-56.

Gibbons, M.R., Ross, S.A. & Shanken, J., 1989. A test of the efficiency of a given portfolio. Econometrica, 57(5), 1121–1152.

{p_end}