The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » General » DISABILITY - UGANDA DHS 2016 ON SAS
DISABILITY - UGANDA DHS 2016 ON SAS [message #17760] Thu, 23 May 2019 04:32
Mlue
Messages: 74
Registered: February 2017
Location: Cape Town
Senior Member
Hello,

In case you're trying to derive the Washington Group disability statistics on SAS using the 2016 Uganda DHS, the code below will guide you in the right direction.

/**** IMPORT SPSS DATA TO SAS ****/

PROC IMPORT DATAFILE="\\HO123456789\Users\User1\Documents\UGANDA DHS 2016\UGANDA_2016 _SPSS_DATA\UGPR7AFL"
	DBMS=SAV
	OUT=WORK.UGANDA_DHS
	REPLACE;
RUN;

/** DISABILITY _ UGANDA DHS 2016 ON SAS **/

DATA DISABILITY_UGANDA;
	SET WORK.UGANDA_DHS;

	weight = (HV005 / 1000000);
	psu    = HV021;
	strata = HV023;

/**** ONLY PERSONS AGED FIVE YEARS AND OLDER ****/

	IF HV105 > 4;

/**** FORMAT ****/

	FORMAT Agegroup $11. Ungandadisab $21.;

/**** DERIVING DISABILITY ****/
	IF SH24 =. OR SH25 =.	THEN	SEEING = 9;
	IF SH24 =1 OR SH25 =1	THEN	SEEING = 1;
	IF SH24 =2 OR SH25 =2	THEN	SEEING = 2;
	IF SH24 =3 OR SH25 =3	THEN	SEEING = 3;
	IF SH24 =4 OR SH25 =4	THEN	SEEING = 4;
	IF SH24 =8 OR SH25 =8	THEN	SEEING = 8;

	IF SH27 =. OR SH28 =.	THEN	HEARING = 9;
	IF SH27 =1 OR SH28 =1	THEN	HEARING = 1;
	IF SH27 =2 OR SH28 =2	THEN	HEARING = 2;
	IF SH27 =3 OR SH28 =3	THEN	HEARING = 3;
	IF SH27 =4 OR SH28 =4	THEN	HEARING = 4;
	IF SH27 =8 OR SH28 =8	THEN	HEARING = 8;

	IF SH29 =.	THEN	COMMUNICATE = 9;
	IF SH29 =1	THEN	COMMUNICATE = 1;
	IF SH29 =2	THEN	COMMUNICATE = 2;
	IF SH29 =3	THEN	COMMUNICATE = 3;
	IF SH29 =4	THEN	COMMUNICATE = 4;
	IF SH29 =8	THEN	COMMUNICATE = 8;

	IF SH30 =.	THEN	REMEMBERING = 9;
	IF SH30 =1	THEN	REMEMBERING = 1;
	IF SH30 =2	THEN	REMEMBERING = 2;
	IF SH30 =3	THEN	REMEMBERING = 3;
	IF SH30 =4	THEN	REMEMBERING = 4;
	IF SH30 =8	THEN	REMEMBERING = 8;

	IF SH31 =.	THEN	WALKING = 9;
	IF SH31 =1	THEN	WALKING = 1;
	IF SH31 =2	THEN	WALKING = 2;
	IF SH31 =3	THEN	WALKING = 3;
	IF SH31 =4	THEN	WALKING = 4;
	IF SH31 =8	THEN	WALKING = 8;

	IF SH32 =.	THEN	SELFCARE = 9;
	IF SH32 =1	THEN	SELFCARE = 1;
	IF SH32 =2	THEN	SELFCARE = 2;
	IF SH32 =3	THEN	SELFCARE = 3;
	IF SH32 =4	THEN	SELFCARE = 4;
	IF SH32 =8	THEN	SELFCARE = 8;

	ARRAY disa2 {6} $  SEEING HEARING COMMUNICATE REMEMBERING WALKING SELFCARE;  

	disab=0;
	sevdisab=0;
	undisab1=0;
	undisab2=0;
	undisab=0;
	discount=0;
	donotknow=0;

		Do k=1 to 6;
			if 2<=disa2{k}<=4 then disab=1;
			if 3<=disa2{k}<=4 then sevdisab=1;
		End;	

		Do i=1 to 6;
			if 3<=disa2{i}<=4 then undisab2=1;
		End;

		Do j=1 to 6;
			if disa2{j}=9 then discount+1;
		End;

		Do l=1 to 6;
			if disa2{l}=8 then donotknow+1;
		End;

		Do n=1 to 6;
			if disa2{n}=4 then undisab1+1;
		End;
	
	if	undisab1>1 then undisab=1;
	if	undisab2=1 then undisab=1;

	if	discount=6 then do;
	   	undisab=9;
		disab=9;
		sevdisab=9;
	end;

	if	donotknow=6 then do;
	   	undisab=8;
		disab=8;
		sevdisab=8;
	end;

	drop k i j l n;

	if HV103=1 & undisab NE 9;

	IF HV105 IN (0:4)		THEN	Agegroup="00-04";
	IF HV105 IN (5:9)		THEN	Agegroup="05-09";
	IF HV105 IN (10:14)		THEN	Agegroup="10-14";
	IF HV105 IN (15:19)		THEN	Agegroup="15-19";
	IF HV105 IN (20:29)		THEN	Agegroup="20-29";
	IF HV105 IN (30:39)		THEN	Agegroup="30-39";
	IF HV105 IN (40:49)		THEN	Agegroup="40-49";
	IF HV105 IN (50:59)		THEN	Agegroup="50-59";
	IF HV105 IN (60:95)		THEN	Agegroup="60+";
	IF HV105 NOT IN (0:95)	THEN	Agegroup="DKN/MISSING";


	Ungandadisab=undisab;

	IF undisab IN (0)	THEN	Ungandadisab="0. Without disability";
	IF undisab IN (1)	THEN	Ungandadisab="1. With disability";
	IF undisab IN (8)	THEN	Ungandadisab="8. DNK";
	IF undisab IN (9)	THEN	Ungandadisab="9. Unspecified";

RUN; 

PROC FREQ DATA=WORK.DISABILITY_UGANDA;
	TABLE undisab Ungandadisab;
	TABLE Agegroup * Ungandadisab /NOCOL NOFREQ NOPERCENT;
	WEIGHT weight;
RUN;

PROC SURVEYFREQ DATA=WORK.DISABILITY_UGANDA;
	TABLES Agegroup * undisab /ROW WT;
	STRATA strata;
	CLUSTER psu;
	WEIGHT weight;
RUN;
Previous Topic: Members of households with foster and/or orphan children
Next Topic: Variables about employment women
Goto Forum:
  


Current Time: Mon Aug 19 21:42:05 Eastern Daylight Time 2019