|  | 
	|  | 
	|  | 
	|  | 
	| 
		
			| Re: sas commands for delivery assistance by health professional [message #12123 is a reply to message #12073] | Thu, 30 March 2017 07:32   |  
			| 
				
				
					| Mlue Messages: 92
 Registered: February 2017
 Location: North West
 | Senior Member |  |  |  
	| Hi, 
 I'm not sure if this is what you're looking for, but I hope it points you into the right direction.
 
 The code below replicates [Table 9.6 Assistance during delivery] - from the Sierra Leone DHS report of 2013
 
 
 PLEASE NOTE THAT I USED THE INDIVIDUAL RECODE FILE (WOMEN DATASET) TO ACHIEVE THE FOLLOWING
 
 Also note that in order to achieve all of this, I had to import Stata data into SAS and analyse as shown below
 
 **========================================================== =========**
 
 SAS programme
 
 
 /** SKILLED BIRTH ATTENDANT **/
DATA SLDHS2013_1;
	SET WORK.SLDHS_2013;
	WHERE m3a in(0,1,9) AND m3b in(0,1,9) AND m3c in(0,1,9) AND v208 in(1,2,3,4);
	/* THE CODE ABOVE SELECTS THE SAMPLE TO MATCH THE TABLE IN THE DHS REPORT */
	/* NOW, TO DERIVE THE DEPENDENT VARIABLE (Skilled_birth)*/
		IF	m3a = 1	or	m3b = 1	or	m3c = 1	THEN	skilled = 1; else
		IF	m3a 	or m3b 		or m3c NE 1 THEN 	skilled = 0;
		FORMAT skilled_birth$32.;
			IF skilled =	0	THEN 	Skilled_birth = "0. Non-skilled provider";
			IF skilled =	1	THEN 	Skilled_birth = "1. Skilled provider";
			WEIGHT = (v005 / 1000000);
	PROC TEMPLATE;
	EDIT BASE.FREQ.CROSSTABFREQS;
	EDIT FREQUENCY;
	FORMAT=BEST12.;
	END;
	END;
RUN;
/* CHECK IF IT MATCHES THE RESULTS ON THE DHS REPORT*/
/* Percentage delivered by a skilled provider in Sierra Leone DHS 2013 report = 59.7% */
PROC FREQ DATA=WORK.SLDHS2013_1;
	TABLE Skilled_birth /NOCOL NOROW;
	WEIGHT WEIGHT;
RUN;
/* CHECK WITH OTHER VARIABLES */
PROC FREQ DATA=WORK.SLDHS2013_1;
	TABLE V025 * Skilled_birth /NOCOL NOFREQ NOPERCENT;
	TABLE V024 * Skilled_birth /NOCOL NOFREQ NOPERCENT;
	TABLE V190 * Skilled_birth /NOCOL NOFREQ NOPERCENT;
	WEIGHT WEIGHT;
RUN;[Updated on: Thu, 30 March 2017 09:41] Report message to a moderator |  
	|  |  | 
	|  | 
	|  | 
	|  |