27.12.2012 Views

The 1995/1996 Household Income, Expenditure - (PDF, 101 mb ...

The 1995/1996 Household Income, Expenditure - (PDF, 101 mb ...

The 1995/1996 Household Income, Expenditure - (PDF, 101 mb ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

WTCALC.SAS 1<br />

0ptions pagesize=60;<br />

libname out 'c:\temp';<br />

filename aO 'c:\process\sampchk.txt';<br />

filename a1 'c:\process\sample1.txt';<br />

/*First get all the actual data from validated final */;<br />

/*Get the household values for cumulative age/sex vars */;<br />

/*Persons is the total nu<strong>mb</strong>er of persons in the k-th sample HH */;<br />

/*in the j-th sample chunk in the i-th sample sv in the h-th stratum*/;<br />

/*sampchk.txt came from sorting the coy rectype by gOY urbrur */;<br />

/*km sv, then proc summary var males females by same key */i<br />

/*<strong>The</strong> actual data has 14 wrong SV or KM codes in the second */i<br />

/*half sample. To attach the weights, these must be corrected */;<br />

/*first. Do this to the raw data first with the program below */i<br />

/**************************************************************<br />

Data sortsamp;<br />

set in.cov;<br />

proc sort; by gOY urbrur km sv; run;<br />

data null;<br />

set sortsarnp;<br />

if gov=1 and urbrur=1 and km=27 and psu=48 then sV=020;<br />

if gov=1 and urbrur=1 and km=34 and psu=60 then sv=030;<br />

if gov=12 and urbrur=O and km=9 and psu=21 then sv=370i<br />

if gov=12 and urbrur=O and km=16 and psu=11 then sv=210;<br />

if gov=12 and urbrur=O and km=16 and psu=12 then sv=390;<br />

if gov=14 and urbrur=O and km=3 and psu=65 then sv=110;<br />

if gov=18 and urbrur=O and km=4 and psu=134 then sv=220;<br />

if gov=18 and urbrur=l and sv=010 and psu=154 then km=12;<br />

if gov=19 and urbrur=O and km=6 and psu=156 then sv=60;<br />

if gov=19 and urbrur=1 and km=l and psu=227 then sv=20;<br />

if gov=23 and urbrur=O and km=3 and psu=186 then sV=20;<br />

if gov=25 and urbrur=1 and km=2 and psu=198 then sv=20;<br />

if gov=28 and urbrur=l and km=6 and psu=216 then sv=20;<br />

if gov=34 and urbrur=O and sv=050 and psu=280 then km=9;<br />

proc summary; var males females; by gOY urbrur km SVi run;<br />

output out=sampchk sum=; run;<br />

*************************************************************/;<br />

DATA first;<br />

infile aO missover;<br />

input gOY 1-8 urbrur 9-17 km 18-26 sv 27-35 psu 36-44<br />

completd 45-53 males 54-62 females 63-71;<br />

persons=males+females;<br />

proc sort;<br />

by gOY urbrur km sv psu;<br />

run;<br />

.,<br />

data second;<br />

/* Weighting of Survey data based on Megill(95) */;<br />

/* urpop is 1986 Census governorate/urban or rural population */;<br />

/* chunks is the nu<strong>mb</strong>er of sample chunks in the stratum */;<br />

/* svpop is the 1986 Census shiakha or village population */;<br />

/* svhhs is the 1986 Census frame # HHs in the shiakha or village */;<br />

infile a1 missover;<br />

input gOY 1-2 urbrur 3-4 km 5-7 sv 9-11 name $ 13-36 psu 37-39<br />

urpop 40-47 chunks 48-50 svpop 51-57 svhhs 58-63;<br />

run;<br />

data one;<br />

set second;<br />

if urbrur=2 then urbrur=o;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!