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

st: Re: Re: correlation panel data

From   Tomas Zamora <>
Subject   st: Re: Re: correlation panel data
Date   Fri, 28 Mar 2003 15:26:56 -0500

Dear Chris,

thanks a lot for yur help. You have been very useful!!!

>i would try just running pairwise regressions betweenyour different
>regressors using xtreg, xtgee, or areg.  to get the correlation between x
>& y this approach, do the following.
>regress y on x.  let's call the coefficient _b[x]
>regress x on y.  let's call that coefficient _b[y]
>now the correlation between x & y is equal to (_b[x]*_b[y])^0.5
>now, let's say "id" is the panel id variable & that there are random
>effects by id.  in stata code, we'd do:
>xtreg y x, re i(id)
>* here we're saving the coefficient in a local macro called `bx'
>local bx = _b[x]
>xtreg x y, re
>local by = _b[y]
>* here we're making a new macro equal to the correlation
>local r = (`bx'*`by')^0.5
>* here we ask stata to show us the value for our new correlation.
>macro list _r

On Thu, 27 Mar 2003, Tomas Zamora wrote:

> Hi all!
> I'm a very new user of Stata and it's wonderful! I'm working with panel data and I'm also new in that. I would like to know how to check for multicollinearity among variables.
> I know the corr comand, but this is not for panel data (unless you work in wide format, but in that case I'm not sure if the results are very good). Then I can use xtcorr, but this should be used after xtgee and I think that the spirit then is to check correlations among residuals, not correlations among variables.
> Can someone help me and give me a hint on how to check correlations among variables before start working?
> Thanks for your help!
> Sincerely,
> Tomas

_________________________________________________________  Gratuito, latino y en espaņol.

*   For searches and help try:

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