Closed achafetz closed 9 years ago
I think this fixes it, right?
Create three livestock variables all related to holdings in time.
local count = 1
foreach x of local lvstk {
bys a01: g x' = k1_04 if (livestock ==
count')
bys a01: g x'2011beg = k1_02a if livestock ==
count'
bys a01: g x'2011end = k1_03a if livestock ==
count'
replace x' = 0 if
x' ==.
replace x'2011beg = 0 if
x'2011beg == .
replace x'2011end = 0 if
x'2011end == .
la var x' "Total
x' owned by hh now "
la var x'2011beg "Total
x' owned in beg 2011"
la var x'2011end "Total
x' owned in end 2011"
bys a01: g x'diff =
x'2011end - x'2011beg la var
x'diff "Change in `x' during 2011"
x':
count' livestock code"
local count = `count'+1count' == 7 { local count =
count' + 1
}
}Code updated to reflect missing 7.
Perfect!
On Mon, Dec 29, 2014 at 3:09 PM, Tim notifications@github.com wrote:
Code updated to reflect missing 7.
— Reply to this email directly or view it on GitHub https://github.com/tessam30/Bangladesh/pull/10#issuecomment-68297634.
Aaron Chafetz Program Analyst E3/Office of Planning, Learning, and Coordination US Agency for International Development (202) 216-3077
1) affected variables - duck, othbirds, other* issue - livestock codes (in section K) run 1-6 and 8-10, skipping over 7. using a loop to count up from 1 to 10 incorrectly codes the livestock related variables. action - added in a "na" livestock in the "lvstk" macro and then delete it after the loop creating the livestock variables.