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

Re: st: Problem with genhw...


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Problem with genhw...
Date   Thu, 22 Aug 2002 12:32:24 +0100

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/



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