Statalist


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

Re: st: correlation for longitudinal data


From   Ricardo Ovaldia <[email protected]>
To   [email protected]
Subject   Re: st: correlation for longitudinal data
Date   Mon, 20 Jul 2009 19:44:41 -0700 (PDT)

Austin Nichol wrote in reply to my question:

>Sure:
>corr y x

The problem is that I have non-independent observations. Longitudinal (panel) data. Multiple measurements per patient over time. Pearson's correlation assumes independence, therefore -corr- is not appropiate.

Thank you,
Ricardo.


Ricardo Ovaldia, MS
Statistician 
Oklahoma City, OK

Ricardo Ovaldia<[email protected]> :
Sure:
corr y x

but I guess you have something else in mind--perhaps you could
clarify.  Maybe you want to allow mean and SD to change over time, and
standardize by time e.g.

webuse psidextract, clear
corr lwage ed
ren lwage y
ren ed x
egen my=mean(y), by(t)
egen sy=sd(y), by(t)
egen mx=mean(x), by(t)
egen sx=sd(x), by(t)
g zy=(y-my)/sy
g zx=(x-mx)/sx
reg zy zx, nocons
corr zy zx


On Mon, Jul 20, 2009 at 9:51 AM, Ricardo Ovaldia<[email protected]> wrote:
>
> Dear all,
>
> Is there a way to estimate a correlation coefficient of two continuous measurements each collected over time on a sample of patients? Not sure if I can do this with -xtreg- for example.
>
> Thank you,
> Ricardo
>
>
> Ricardo Ovaldia, MS
> Statistician
> Oklahoma City, OK
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/




      
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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