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

st: Re: Re: Multiple paired ttests


From   "Kaaresen Per Ivar" <[email protected]>
To   <[email protected]>
Subject   st: Re: Re: Multiple paired ttests
Date   Thu, 9 Sep 2004 00:56:16 +0200

Ikke sensitiv - Please ignore this message - it is due to inhouse
security

Thank you Jean.

However, I now realize I was inaccurate in describing my variable
names.In fact they are named

dimm atmm comm.......  and dimf atmf comf.......

and I want to cycle through

ttest dimm==dimf
ttest atmm==atmf

and so forth. Sorry for this. Any ideas?

Regards


Per Ivar Kaaresen MD
University of Tromsoe
Norway


-----Opprinnelig melding-----
Fra: jean ries [mailto:[email protected]] 
Sendt: 9. september 2004 00:35
Til: [email protected]
Emne: st: Re: Multiple paired ttests

Try the following:

forval i = 1/n {
     ttest x`i'mm == x`i'mf
}

cheers,

-- jean

> I have quite a number of variables named x1mm x2mm x3mm.... and x1mf
> x2mf x3mf....
>
> Now I want to run multiple ttest:
>
> ttest	X1mm==x1mf
> ttest x2mm==x2mf
>
> and so forth.
>
> How can I do this without typing each command over and over again?
>
> I suppose some looping as:
>
> foreach v of varlist x1mm-xnmm {
> 	ttest `v'== (but what here??)
>
> 	}
>
> Thank you in advance for your help
>
> Regards
>
> Per Ivar Kaaresen MD
> University of Tromsoe
> Norway

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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