Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: calculating outer products


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: calculating outer products
Date   Wed, 5 Mar 2008 11:34:18 -0500

Stephen Younger <syounger@ithaca.edu>:
I sincerely doubt you need to calculate such large products, but see

help mat accum
help mf_cross

Maybe if you describe the actual calculation, using a -sysuse- dataset like so:

sysuse auto, clear
reg mpg wei, nohe
mat li e(V)
mat accum xx=wei
predict e, res
g e2=e^2
su e2
loc s=r(mean)
mat V=74/(72)*`s'*invsym(xx)
mat li V

someone can suggest a more efficient solution (probably using Mata).

Are you by any chance recreating the -cluster- option?

On Wed, Mar 5, 2008 at 10:13 AM, Stephen D Younger <syounger@ithaca.edu> wrote:
> Hello,
>
> I need to calculate outer products of data vectors to estimate the
> standard errors of income or tax shares. Ideally, these would be
> (NxK)*(KxN), though (Nx1)*(1xN) would do. N is pretty large, 1000-5000
> records, usually. Is there a way to do this in Stata?
>
> --
> Stephen D. Younger
> syounger@ithaca.edu
> 607 274 3134
>
*
*   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