Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: bivariate correlation analsis for longitudinal data


From   Michael Mitchell <[email protected]>
To   [email protected]
Subject   Re: st: bivariate correlation analsis for longitudinal data
Date   Sun, 23 May 2010 12:32:13 -0700

Greetings Junqing

  If you have not done so already, you probably want to reshape your data
into a "long" format (e.g., see
http://www.ats.ucla.edu/stat/stata/modules/reshapel.htm).

  Having the data in a long format, you can then look at bivariate
relationships between a continous predictor and continuous outcome
like this (using the nlswork dataset as an example).

. webuse nlswork
. xtmixed ln_wage tenure || idcode:

  The above looks at "tenure" predicting "ln_wage", with no random
effects at level 2. If you are interested in assessing the variability
of "tenure" as a random slope, you can do something like this...

. xtmixed ln_wage tenure || idcode: tenure, cov(un)

  As I mentioned in a previous post, I cannot recommend the following
book highly enough for learning and as a reference for longitudinal
analysis...

  Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence
by Judith D. Singer & John B. Willett, see
http://gseacademic.harvard.edu/alda/

I hope this helps,

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com


On Sun, May 23, 2010 at 11:07 AM,  <[email protected]> wrote:
> I try to do bivairate correlation analysis for longitudinal data. My
> understanding is to use the data in wide format and then do regular
> correlation of the x and y vairables, for example correlation of x at time
> 1 and y at time 2, x at time 2 and y at time 3, etc., or x and y both at
> the same time point. By doing so, do i assume that time effect is the name
> on the correlations at different time point? What is the appropriate way
> of conducting bivairate correlation analysis for longitudinal data?
>
> Eventually, i will fit randome intercept models for y on Xs. Thanks a lot.
>
> Junqing
>
>
>> Dear David
>>
>>    I think that it might help if we were able to see a picture of the
>> graph that you have
>> in mind. Of course, sharing such a picture is not easy via Statalist, but
>> you could draw
>> something and share it using Jing, see
>>
>> http://www.michaelnormanmitchell.com/stow/capturing-and-sharing-screen-images.html
>>
>>    I think that the growth model that you have in mind does not involve
>> any of the
>> interaction effects (note that age and age squared are not interacted with
>> anything) thus
>> when you look at the trajectory over time, the interactions you refer to
>> just get
>> "averaged out". I think it is possible that you might actually want more
>> than one graph,
>> for example you might like...
>>
>>    1) a graph with age on the X axis, the predicted outcome on the y axis,
>> and separate
>> lines for maternal IQ groups/treatment groups. This shows the growth curve
>> over time for
>> the six groups. Note that the growth curves will be parallel.
>>
>>    2) a graph with maternal IQ class on the X axis, separate lines for
>> treatment groups.
>> This will focus on the interaction.
>>
>>    There may be multiple ways to touch the elephant, but I don't think
>> there is one way to
>> touch the elephant to get the entire picture. It is also possible that you
>> might be
>> interested in interacting age (and perhaps age squared) with some of your
>> other predictors
>> if you think that the growth trajectory depends on these factors.
>>
>>    Finally, I would recommend "Applied Longitudinal Data Analysis:
>> Modeling Change and
>> Event Occurrence" by Judith D. Singer and John B. Willett to anyone who is
>> interested in
>> these kinds of models. It does not solve this exact problem, but is an
>> outstanding
>> reference, see
>>
>> http://www.ats.ucla.edu/stat/examples/alda.htm
>>
>> I hope this helps,
>>
>> Michael N. Mitchell
>> Data Management Using Stata      -
>> http://www.stata.com/bookstore/dmus.html
>> A Visual Guide to Stata Graphics -
>> http://www.stata.com/bookstore/vgsg.html
>> Stata tidbit of the week         - http://www.MichaelNormanMitchell.com
>>
>>
>>
>> On 2010-05-22 5.52 PM, David Torres wrote:
>>> Hello,
>>>
>>> I actually came upon the link Nick provided in a previous post
>>> (http://www.ats.ucla.edu/stat/stata/faq/mar_graph/margins_graph.htm)
>>> while I was working on this earlier today. The graph I was able to
>>> produce does seem useful in that it shows the difference in slope
>>> between child IQ scores of the different maternal IQ classes for both
>>> the control and treatment groups. I wonder, though, if I'm missing
>>> something by not showing growth. ???
>>>
>>> Since the data include assessments at several time points (8 to be
>>> exact), should I not want a graph of the adjusted means at each time by
>>> maternal IQ and treatment group assignment? And shouldn't it be
>>> curvilinear given the quadratic? I guess I would like a growth curve
>>> that takes into account significant interaction effects.
>>>
>>> --------------------------------------------
>>>
>>> David Diego Torres, MA(Sociology)
>>> PhD Candidate in Sociology
>>>
>>>
>>> *
>>> * 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/
>>
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index