Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: grouping cases

From   "Jacobs, David" <>
To   "''" <>
Subject   st: RE: grouping cases
Date   Fri, 7 Oct 2011 17:44:49 +0000

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.

-----Original Message-----
From: [] On Behalf Of Yang, Chongmin
Sent: Friday, October 07, 2011 11:45 AM
To: statalist
Subject: st: grouping cases

Dear statalist.

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
replace oecd=2 if oecd==.

Is there more efficient way than mine? I think it's very tough to make

*   For searches and help try:

*   For searches and help try:

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