The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Mortality » Cox Model and Recoded Variables From BR File (Negative Coding for Dotted (.) Observation)
Cox Model and Recoded Variables From BR File [message #20206] Thu, 08 October 2020 01:41 Go to previous message
shujaat.smc@gmail.com is currently offline  shujaat.smc@gmail.com
Messages: 75
Registered: July 2020
Senior Member
Dear DHS Representative,

I am working on Sub-population of neonates with Bw2500gms and above, looking for determinants of mortality among them in four provinces of Pakistan.

I recode the following variables using "Negative Coding" for dotted observations and Low birth weight babies using following commands;

****Size of child at birth****
recode m18 (4/.=-1 "NotApp&Lower") (3=1 "Average") (2=2 "LargerThanAvg") (1=3 "VeryLarge"), gen (percievedsizeofbaby)

*******When the Child First put to breats *****

recode m34 (0/201=1 "DayofBirth") (202/207=2 "Between2nd-7thDayofBirth") (208/230=3 "From8th-30thDayofBirth") (.=-1 "NotApp"), gen (breastfeedingpractice)

**** Variable Birthorder bord recoding *********

recode bord (1=1 "First") (2=2 "Second") (3=3 "Third") (4=4 "Fourth") (5/15=5 "FifthorAbove"), gen (BirthorderofNewborn)

************************************************************ *****************
I use these new variables for cox-model using command

svy linearized, subpop(subpopulationbw2) : stcox ib(last).breastfeedingpractice ib(last).BirthorderofNewborn ib(first).percievedsizeofbaby

******* My Question is on the following error message from stata 13.1 ****

🚩Note: subpop() takes on values other than 0 and 1
subpop() != 0 indicates subpopulation
(running stcox on estimation sample)

breastfeedingpractice: factor variables may not contain negative values
an error occurred when svy executed stcox 🚩r(7);


Kindly explain what mistake I am making in recoding & generating new variables and why got this error in stata.

Truely obliged and appreciate your quick responses for my questions asked earlier.

Best Regards

Dr. Hussain
 
Read Message
Read Message
Previous Topic: maternal mortality
Next Topic: Previous pregnancy birth interval in months
Goto Forum:
  


Current Time: Sat Apr 27 06:54:42 Coordinated Universal Time 2024