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

Re: st: Problem with genhw...


From   "Neil Shephard" <mdeasnds@fs1.ser.man.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Problem with genhw...
Date   Thu, 22 Aug 2002 15:52:58 +0100

Nick

I did want to look at positions 1 and 2, 3 and 4 etc. etc., and Mark 
Holmes solution worked fine.

Sorry for not closing the thread.

Neil

> Neil Shephard asked
> 
> > I have a load of genotype data for a whole genome screen and
> > simply want to test each locus for Hardy-Weinberg equilibrium
> > using the -genhw- command.  Since there are 370 markers I
> > thought I'd use the following to achieve this...
> >
> > tokenize d*
> > while "`1'" ~= ""{
> > 	genhw `1' `2'
> > 	mac shift 2
> > }
> >
> > However upon execution I'm told that
> >
> > too many variables specified
> > r(103)
> >
> > genhw works fine if I type in the variable names, but this is very
> > repetative (boring and time consuming).
> >
> > Can anyone suggest why this might be happening.
> >
> 
> and G. Mark Holmes answered
> 
> > If you tokenize d* you will get "d*" in `1' (literally). That is,
> tokenize
> > will not exapnd varlists.
> 
> > One solution:
> 
> > unabbrev d*
> > tokenize $S_1
> > while "`1'" ~= ""{
> >       genhw `1' `2'
> >       mac shift 2
> > 	}
> 
> The code here looks at variables with positions within -d*-
> 1 and 2, 3 and 4, 5 and 6, etc. Is that what is
> desired?
> 
> Nick
> n.j.cox@durham.ac.uk
> 
> 
> *
> *   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/



Neil Shephard
Genetics Statistician
ARC Epidemiology Unit, University of Manchester
neil.shephard@man.ac.uk
neil.shephard@mindless.com

"Contrariwise, if it was so, it might be; and if it
were so it would be; but as it isn't, it ain't. That's
logic" - Tweedledee (Alice Through the Looking Glass)
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index