Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: correlation, panel data

From   "Biljana Dlab" <>
To   <>
Subject   RE: st: correlation, panel data
Date   Wed, 13 Oct 2010 16:35:16 +0200


I have panel data (sorted by firm and financial years).

Now I am trying to compute correlation between variables r_d and cf - I would like to have this correlation in a separate column in spread-sheet and that the correlation coefficient is written for all firm-year observations

With other words this is what I would like to get:

Firm year corr(between r_d&cf)
A	99	0.2
A	00	0.2
A	01	0.2
A	02	0.2
B	99	0.4
B	00	0.4
B	01	0.4

I tried like this:
.by gvkey_n: corr cf r_d  - but then I get whole listing in front of me of the correlation and not the column in the spread-sheet

If I try:
. by gvkey_n: egen d_corr = corr(cf r_d)
unrecognized command:  _gcorr

. ssc install egenmore
checking egenmore consistency and verifying not already installed...
file C:\DOCUME~1\dlab\LOCALS~1\Temp\ST_0100000g.tmp already exists
could not copy
(no action taken)

Do you know the function how to get correlation in the column?

-----Original Message-----
From: [] On Behalf Of Maarten buis
Sent: 13 October 2010 16:26
Subject: Re: st: correlation, panel data

--- On Wed, 13/10/10, Biljana Dlab wrote:

2) the -corr()- command inside -egen- is user-writen. It 
comes from -egenmore-, which can be downloaded by typing
-ssc install egenmore-. Posters are asked to explicitly
state where they downloaded user written programs as there
are often multiple versions floating around in cyber space,
and answers often depend on the version. 

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index