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

RE: st: RE: Compact list of correlation, by cross-section


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: Compact list of correlation, by cross-section
Date   Tue, 3 Aug 2004 20:54:51 +0100

One point only, as below. 

Nick 
n.j.cox@durham.ac.uk 

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Michael S.
> Hanson
> Sent: 03 August 2004 20:39
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: RE: Compact list of correlation, by cross-section
> 
> 
> On Aug 3, 2004, at 12:53 PM, Nick Cox wrote:
> 
> > The condition "if idn == `i'" is not only illegal,
> > but in any case irrelevant to the -display-.
> > It should just be omitted. That is, the -correlate-
> > command already took care of the restriction
> > you want, and there is only one correlation
> > available to display, so no ambiguity.
> 
> 	Unfortunately, omitting the second "if" condition does 
> not produce 
> what I am looking for:  since there are t observations for 
> each id, t > 
> count(id) = 50, the first id is shown 50 times along with the 
> (otherwise correct) correlation coefficients.  Given the solutions 
> below, I'm not going to spend more time on this now....

I don't see the problem, either from this or from your 
original code. Any way, you must loop over distinct 
groups, _not_ observations. 

*
*   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