Use "egen" w/ the "sum" option.
----- Original Message -----
From: "Ronnie Babigumira" <[email protected]>
To: <[email protected]>
Sent: Thursday, January 16, 2003 10:47 AM
Subject: st: generating new variable
> Hi listers
> Happy new year (hope its not too late for this). I have some household
data
> with a number of variables indicating whether or not a household carried
out
> a given practice (cropre00 mulch00 grman00). An example is given below (1
if
> pursued, 0 otherwise)
>
> houscode cropre00 mulch00 grman00
> 12110001 0 0 0
> 12110002 0 0 0
> 12110003 1 0 0
> 12401001 1 0 0
> 12401002 0 0 0
> 12401003 0 0 0
> 12403001 0 0 0
> 12403002 0 0 0
> 12403003 1 0 0
> 14110021 0 0 0
>
> I want to generate new variables
> 1. npracts, which is the number of practices a household carried out
> 2. A number of dummies eg
>
> oneprac "Household pursued atleast one practice"
> twoprac "Household pursued atleast two practice"
>
> Any ideas
>
> Ronnie
>
> *
> * 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/
>
>
*
* 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/