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

st: generating new variable


From   "Ronnie Babigumira" <[email protected]>
To   <[email protected]>
Subject   st: generating new variable
Date   Thu, 16 Jan 2003 16:47:20 +0100

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/



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