Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: generate 3.000 dummies


From   "Joseph McDonnell" <josephmcdonnellnl@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: generate 3.000 dummies
Date   Wed, 25 Oct 2006 07:15:04 +0200

From: "Cristian Mackenna" <chicomackenna@hotmail.com>
Reply-To: statalist@hsphsun2.harvard.edu
To: statalist@hsphsun2.harvard.edu
Subject: st: generate 3.000 dummies
Date: Wed, 25 Oct 2006 03:08:16 +0000

If I have a database like this:

id_place	id_person
1	1
1	2
1	3
2	4
2	5
2	6
3	7
3	8
3	9
	
3000	200000

Is there any fast way to generate a dummy for every of the 3.000 id_place

forvalues j=1(1)3000 {
gen dummy`j'=(id_place==`j')
}

but I doubt you really want to go down that path. That number of dummies is excessive to say the least.

Joseph

_________________________________________________________________
Talk with your online friends with Messenger http://www.join.msn.com/messenger/overview

*
* 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