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

st: Re: RE: Re: Re: Multiple paired ttests

From   "Kaaresen Per Ivar" <>
To   <>
Subject   st: Re: RE: Re: Re: Multiple paired ttests
Date   Thu, 9 Sep 2004 11:57:03 +0200

Ikke sensitiv - Please ignore this message - due to in-house  security

Thank you, Nick.

Your first loop works perfectly for me.


Per Ivar

-----Opprinnelig melding-----
Fra: Nick Cox []
Sendt: 9. september 2004 11:38
Emne: st: RE: Re: Re: Multiple paired ttests

Let's assume optimistically that the wildcard *mm 
includes all the variables you want on one side. 
You could do this: 

foreach m of var *mm { 
	local f = substr("`m'",1,length("`m'")-1) + "f" 
	ttest `m' == `f' 

The first line in the loop could also be 

	local f = reverse(substr(reverse("`m'"),2,.)) + "f" 

but that's a bit of a backwards solution. You might 
also consider 

	local f : subinstr local m "mm" "mf" 

but that is more dangerous. 

The multiple comparisons issue of firing a shotgun 
in this way I leave on one side. 


Kaaresen Per Ivar
> 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?

*   For searches and help try:

*   For searches and help try:

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