Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: simple matrix calculations


From   Stuart Jordan <sjordan@Princeton.EDU>
To   statalist@hsphsun2.harvard.edu
Subject   st: simple matrix calculations
Date   Tue, 04 Feb 2003 18:13:11 -0500

I am trying to find a simple way to compute X'Z in stata where X is an n
by k matrix, and Z is an n by l matrix with k>=l, and where these
matrices are made up of columns of observations from my dataset.  The
stata programming manual makes it sound as if this should be
straightfoward using one of the matrix accum commands...but the only
ways I've been able to figure out how to do it with these commands
require a burdensome amount of complicated code.

I'm not able to do this using the mkmat command because my dataset is
too large given stata 8's maximum matsize of 800.

In case it matters, the application I want to use this for is to compute
X'Z where X is a matrix of observations on a set of exogenous regressors
and instruments and Z is a matrix of observation on a set of the same
exogenous regressors and a set of endogenous regressors.

Even though I could do this in Matlab or Gauss easily, I use stata more
often, so would like to learn how to do it there.

Thanks,

Stu Jordan

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index