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]

st: Grand mean


From   Debs Majumdar <[email protected]>
To   [email protected]
Subject   st: Grand mean
Date   Mon, 14 Mar 2011 17:04:42 -0700 (PDT)

Hello Statalisters,

  I have a longitudinal dataset with around 500 people and 4 time points which 
looks like the following:


 id     vis      roi      reg       mean
101    1    Frontal    B    1.179829 | 
101    1      Temp    L    1.155491 | 
101    1   Angular    R     1.25507 | 
101    1      Temp    R    1.155153 | 
101    1       Post    B    1.351274 | 
101    1   Angular    L    1.221858 | 
-------------------------------------------------| 
101    2    Frontal    B    1.129451 | 
101    2      Temp    R    1.139536 | 
101    2   Angular    R    1.206856 | 
101    2       Post    B     1.33327 | 
101    2      Temp    L    1.085078 | 
101    2   Angular    L    1.164232 | 
.........                                      
.......
.....

I want to create a grand mean for each participant at each of the time points.

eg. for ID=101 and visit=1; grand_mean = (1.179829 + 1.155491 + ... + 
1.221858)/6

         ID=101 and visit=2; grand_mean = (1.129451 + 1.139536 + ... + 
1.164232)/6   and so on...


Aldo, I wan to create a different grand mean just using mean values for Temp and 
Angular i.e. for ID=101

ID=101 and visit=1; grand_mean = (1.155491 + 1.25507 + 1.155153 + 1.221858)/4 
and so on.

Is there an easy way to accomplish this?

Thanks,

Debs


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