You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Malawi:
* Changes to crop yield accounting in MWI W4 - corrects issue with kgs_harvested.
* Changes to crop yield accounting to reduce code
* Changes to top crops for MWI W3, where there was a transposed crop code; overall edits to the list across the
* Temporarily removed a section from the consumption section because it wasn't collapsing properly - to be addressed in a future update.
* Nigeria
* Adjustment to inflation in W5
* Corrected year in monetary variable labels in all waves
---------
Co-authored-by: David Aplyn <daplyn@uw.edu>
if _rc==0 merge 1:1 hhid using "${MWI_IHPS_W2_created_data}/MWI_IHPS_W2_`c'_monocrop_hh_area.dta", nogen
5276
5293
}
5277
5294
5278
5295
global empty_crops ""
5279
5296
5280
5297
foreach c in $topcropname_area {
5281
-
capture confirm var `c'_monocrop //Check to make sure this isn't empty.
5282
-
if!_rc {
5283
-
egen `c'_exp = rowtotal(val_*_`c'_hh) //Only explicit costs for right now; add "exp" and "imp" tag to variables to disaggregate in future
5298
+
la var `c'_monocrop_ha "Total `c' monocrop hectares planted - Household"
5299
+
foreach v in herb inorg labor orgfert pest plotrent {
5300
+
capture confirm var val_`v'_`c'_hh
5301
+
if _rc {
5302
+
gen val_`v'_`c'_hh=.
5303
+
}
5304
+
}
5305
+
egen num_miss = rmiss(val_*_`c'_hh)
5306
+
egen `c'_exp = rowtotal(val_*_`c'_hh) if num_miss!=6 //Only explicit costs for right now; add "exp" and "imp" tag to variables to disaggregate in future; will be missing if all subcategories are missing.
5284
5307
lab var `c'_exp "Crop production costs(explicit)-Monocrop `c' plots only"
5285
-
la var `c'_monocrop_ha "Total `c' monocrop hectares planted - Household"
5308
+
5286
5309
*disaggregate by gender of plot manager
5287
5310
foreach i in male female mixed{
5288
-
egen `c'_exp_`i' = rowtotal(val_*_`c'_`i')
5311
+
egen `c'_exp_`i' = rowtotal(val_*_`c'_`i') if num_miss!=6
5289
5312
local l`c'_exp : var lab `c'_exp
5290
5313
la var `c'_exp_`i' "`l`c'_exp' - `i' managed plots"
5291
5314
}
5292
5315
replace `c'_exp = . if `c'_monocrop_ha==. // set to missing if the household does not have any monocropped plots
5293
-
foreach i in male female mixed{
5316
+
foreach i in male female mixed{
5294
5317
replace `c'_exp_`i' = . if `c'_monocrop_ha_`i'==.
5295
5318
}
5319
+
drop num_miss
5296
5320
}
5297
-
else {
5298
-
global empty_crops $empty_crops `c'
5299
-
}
5300
-
5301
-
}
5302
5321
5303
5322
5304
5323
merge 1:1 hhid using "${MWI_IHPS_W2_created_data}/MWI_IHPS_W2_land_rights_hh.dta", nogen
@@ -5435,7 +5454,7 @@ merge 1:1 hhid using "${MWI_IHPS_W2_created_data}/MWI_IHPS_W2_fertilizer_applic
5435
5454
*Agricultural wage rate
5436
5455
merge 1:1 hhid using "${MWI_IHPS_W2_created_data}/MWI_IHPS_W2_ag_wage.dta", nogen
5437
5456
*Crop yields
5438
-
merge 1:1 hhid using "${MWI_IHPS_W2_created_data}/MWI_IHPS_W2_yield_hh_crop_level.dta", nogen
5457
+
// merge 1:1 hhid using "${MWI_IHPS_W2_created_data}/MWI_IHPS_W2_yield_hh_crop_level.dta", nogen
5439
5458
*Total area planted and harvested accross all crops, plots, and seasons
5440
5459
merge 1:1 hhid using "${MWI_IHPS_W2_created_data}/MWI_IHPS_W2_hh_area_planted_harvested_allcrops.dta", nogen
5441
5460
*Household diet
@@ -5521,11 +5540,11 @@ lab var fishing_hh "1= Household has some fishing income"
5521
5540
*Recoding missings to 0 for households growing crops
5522
5541
recode grew* (.=0)
5523
5542
*all rural households growing specific crops
5524
-
forvalues k=1(1)$nb_topcrops {
5525
-
local cn: word `k' of $topcropname_area
5526
-
recode value_harv_`cn' value_sold_`cn' kgs_harvest_`cn' total_planted_area_`cn' total_harv_area_`cn' `cn'_exp (.=0) if grew_`cn'==1
5527
-
recode value_harv_`cn' value_sold_`cn' kgs_harvest_`cn' total_planted_area_`cn' total_harv_area_`cn' `cn'_exp (nonmissing=.) if grew_`cn'==0
saveold "${MWI_IHPS_W2_final_data}/MWI_IHPS_W2_household_variables.dta", replace // NOTE TO DEV: filename MWI... is intentionally different from standard file naming format. Keep MWI for Summary Stat file compatibility
0 commit comments