Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: RE: grouping cases |
Date | Fri, 7 Oct 2011 18:52:09 +0100 |
any way of defining an indicator for OECD countries except by spelling out which countries they are. If the dataset was mostly OECD countries then you could define the complement, but otherwise the answer I think is No. Nick On Fri, Oct 7, 2011 at 6:44 PM, Jacobs, David <jacobs.184@sociology.osu.edu> wrote: > If you have a nation id variable, just place an "i." in front of the nation id variable in models. Assuming you are using version 11 or later that will produce dummies for each nation in your model. If you want permanent dummies, look up tabulate oneway. If a generate modifier is added after a coma to tabulate, this creates separate dummy variables for every value of a variable. Yang, Chongmin > I want to choose oecd members from all countries and make dummy variables. > So I wrote like this way: > > gen oecd=1 if country=="Australia" | country=="Austria" | > country=="Belgium" | country=="Canada" | country=="Chile" | > country=="Czech Republic" | country=="Denmark" | country=="Estonia" | > country=="Finland" | country=="France" | country=="Germany" | > country=="Greece" | country=="Hungary" | country=="Iceland" | > country=="Ireland" | country=="Israel" | country=="Italy" | > country=="Japan" | country=="Korea, Republic of" | > country=="Luxembourg" | country=="Mexico" | country=="Netherlands" | > country=="New Zealand" | country=="Norway" | country=="Poland" | > country=="Portugal" | country=="Slovakia" | country=="Slovenia" | > country=="Spain" | country=="Sweden" | country=="Switzerland" | > country=="Turkey" | country==" United Kingdom" | country=="United > States" > replace oecd=2 if oecd==. > > Is there more efficient way than mine? I think it's very tough to make > variables. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/