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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: foreach? forvalues?


From   Phil Clayton <philclayton@internode.on.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: foreach? forvalues?
Date   Mon, 4 Jun 2012 22:02:41 +1000

Here are a few possibilities to explore:

bysort Time Diet: summarize Score
or
collapse (mean) Score, by(Time Diet)
or
statsby, by(Time Diet) clear: ci Score

Phil

On 04/06/2012, at 9:55 PM, Alberto R Osella wrote:

> Dear Statalisters,
> I'm using Stata 12.1 on W7.
> I'd like to obtain , say, the mean of Score for each combination of Time And Diet:
> Time  Diet  Score
> 0         1        3.5
> 3         1       2.8
> 6         1       2.5
> 0         2       4.5
> 3         2       4.2
> 6         2       3.9
> I've tried but not was able.
> Can you helop me?
> Best
> 
> -- 
> Alberto R. Osella, MD, PhD
> Laboratorio di Epidemiologia e Biostatistica
> IRCCS Saverio de Bellis
> Via Turi, 27
> 70013 Castellana Grotte (BA)
> Italia
> Tel:    +39 0804994655
> Fax:    +39 0804994650
> e-mail: arosella@irccsdebellis.it
> 
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index