The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » Exclusive Breastfeeding Variable Lesotho (Creating an Exclusive Breastfeeding Variable)
Exclusive Breastfeeding Variable Lesotho [message #17436] Sun, 17 March 2019 14:47 Go to previous message
LisaSh is currently offline  LisaSh
Messages: 1
Registered: April 2018
Location: Baltimore, MD
Member
I created an exclusive breastfeeding variable using the 2014 Lesotho data, but my exclusive breastfeeding rate does not match the rate in the Final Report.

Does anyone have any ideas on where the error in my SAS code is? The rate I am coming up with is 3.77% which is much lower than the rate in the report.


data babies;
set dhs.lsbr71fl;
age = v008 - b3; /*v008 is century month code of interview; b3 is century month code for dob of child */


if age <= 6 and b5 = 1 and b9 = 0;
/*subset down to living children ages 12 mos and younger living with the mother.
b5 is whether child is alive or dead at time of interview
b9 is person baby lives with and 0 is the mom*/

*compute weights;
weight = v005/1000000;

ClusterMerge=V001;
LineMerge=V003;
HHMerge=V002;
run;

proc freq data=babies order= freq; table caseid/list missing out=freq_out; run;
data twins; set freq_out;
where count=2;
run;

proc sort data=babies; by caseid; run;
proc sort data =twins ; by caseid; run;
data babies_no_twins;
merge twins (in=a) dhs.women_dset_recode(in=b) babies;
by caseid;
if b=1 and a=0;
run;

**********************************;
* Feeding ;
**********************************;

data feeding(drop = i j);
set babies_no_twins/*babies_nodupped*/;

water = 0;
liquids = 0;
milk = 0;
solids = 0;
breast = 0;

*water;
if v409 = 1 then water = 1;

*liquids;
array liqs(*) v409a v410 v410a v412c v413:;
do i = 1 to dim(liqs);
if liqs(i) = 1 then liquids = 1;
end;

*milk;
if v411 = 1 or v411a = 1 or v412 = 1 then milk = 1;

*solids;
array sols (*) v412a v412b v414:;
do j = 1 to dim(sols);
if sols(j) = 1 then solids = 1;
end;

*still breastfeeding;
if m4 = 95 then breast = 1;

*Create hierarchy of FEEDING;
feeding = 1; *feeding starts at 1, excl. b.f. for all babies;
if water = 1 then feeding = 2; *change from 1 to 2 if any water;
if liquids = 1 then feeding = 3; *change from 1 to 3 if any other liquids;
if milk = 1 then feeding = 4; *change to 4 if any milk given;
if solids = 1 then feeding = 5; *change to 5 if any solids;
if breast = 0 then feeding = 0; *change to zero if NOT still breastfeeding;

run;

proc format;
value feeding
0 = "Not breastfeeding"
1 = "Exclusive breastfeeding"
2 = "+Water"
3 = "+Liquids"
4 = "+Other Milk"
5 = "+Solids"
;
run;
data dhs.feeding_cats;
set feeding;

if feeding = 1 then bf = 1;
else bf = 0;
run;

proc freq data=dhs.feeding_cats; table bf; run;
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Query regarding child BMI standard deviation
Next Topic: Sampling weights
Goto Forum:
  


Current Time: Fri Apr 19 05:35:41 Coordinated Universal Time 2024