Statalist


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

Re: st: Problem with statsby and correlate


From   n j cox <n.j.cox@durham.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Problem with statsby and correlate
Date   Sun, 21 Oct 2007 22:53:28 +0100

As you report, -correlate- only leaves behind one covariance
in memory. In any case, you can't stuff a matrix into
a single value of a single observation, which in effect
you are trying to do.

You need a very different approach. Off-hand,
I am not clear what is best for your data structure.
It may well be that you need a different data structure.
If this were my problem, I would -reshape long- first.

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

Pavlopoulos.D.

I want to produce a file with the autocovariance matrix of wage for 7 subsequent years. I have my data organized in such a way that I have one income variable per year, so the wage variables in my dataset are:

lhwage1995 lhwage1996 lhwage1997 lhwage1998 lhwage1999 lhwage2000 lhwage2001


Then, I run:

statsby ,by(country) clear: corr lhwage1995 lhwage1996 lhwage1997 lhwage1998 lhwage1999 lhwage2000 lhwage2001, covariance

But then I get a dataset where only the covariance between lhwage1995 lhwage1996 for every country is saved. The rest of the covariances disappear. Do you know how can I solve this? The `by' option is not the one creating the problem. I tried to remove it but things didn't change.

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