Path: news.mathworks.com!not-for-mail
From: Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Cross-Sectional Regression
Date: Fri, 20 Feb 2009 10:29:26 -0500
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <gnmi8m$6n2$1@fred.mathworks.com>
References: <gnkqvq$lhs$1@fred.mathworks.com>
NNTP-Posting-Host: perkinsp.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1235143766 6882 172.31.57.88 (20 Feb 2009 15:29:26 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 20 Feb 2009 15:29:26 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
In-Reply-To: <gnkqvq$lhs$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:519712


Hans Schmidt wrote:
> Hey folks,
> 
> I've a question concerning running cross sectioinal regressions in ML and getting regression statistics.
> 
> Suppose I've a dependent variable Y (100 return observations x 1000 firms) and I've 5 beta coefficients (5x1) that should explain the cross section of Y. So for each one of the 100 return observations, I would like to do a cross sectional regression on the 1000 firms reporting me coefficients, t-stats, standard errors and Rsquared.
> 
> Is there a clever way to do it? The function regress does not seem to work in the case of cross-sectional regressions.

Hans, REGRESS will fit any univariate linear regression you want, you just have to create the right design matrix.

You haven't mentioned any predictor variables, but you do mention 5 coefficients, so perhaps you have 5 predictor variables, or four plus an intercept.  I'm not an econometrician, but I'm guessing that you have data at 100 times, and you want to model each of the 100 1x1000 vectors of returns as a function of your predictors values at each of those times.  What I don't know is if you want common estimates across times for some or all of the coefficients.

If you don't, then you'd just call regress 100 times.  If you do, then you'll need to set up an appropriate design matrix.  What you're asking for may be a standard thing in financial modelling, but I'm not relly up on that jargon.

Hope this helps.