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

Re: st: Avoiding specific values in a local variable

From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   Re: st: Avoiding specific values in a local variable
Date   Fri, 31 Oct 2003 00:28:26 +0000

forvalues x=3111/3909{
twoway (line relwage year, sort)  if isic==`x' 

I have a panel data set with coded industries, the first and last codes being 3111 and 3909 respectively. In actual fact, there are only about 80 industries in total  rather than 799 (3909 minus 3111). Is there a way I can ask Stata to avoid the remaining 719 industries when looping the command over each industry, as non-existing industries would produce a blank graph and would make the looping time-consuming. I know that one option would be to define a local of the 80 industries, but I am sure there is another more straightforward way which I am not aware of.

Please help

Many thanks

*   For searches and help try:

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