10.04.2013 Views

STATA 11 for Windows SAMPLE SESSION - Food Security Group ...

STATA 11 for Windows SAMPLE SESSION - Food Security Group ...

STATA 11 for Windows SAMPLE SESSION - Food Security Group ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Stata <strong>11</strong> Sample Session Section 4 – Tables and Graphs, Survey estimation<br />

strata. Strata are considered to be statistically independent and<br />

can be analyzed as such.<br />

A weight has already been calculated <strong>for</strong> each household. The<br />

variable which contains this value is called hhwgt.<br />

We need to compute the cluster variable. We can use dist <strong>for</strong><br />

the strata variable since it already contains the province value<br />

as part of the district code.<br />

Close the browser and use the gen command to create the<br />

variable “cluster1”.<br />

To be able to use the survey commands, we must first<br />

define the stratified random sampling method that was used to<br />

account <strong>for</strong> weighting, clustering and stratification. We will<br />

use the svyset command to specify the method.<br />

1. Click on Statistics then Survey data analysis<br />

2. Then click on Setup & utilities then Declare<br />

survey design <strong>for</strong> dataset<br />

3. In the Primary sampling unit: box select cluster1<br />

4. In the Strata: box select dist<br />

5. Click on the Weights tab<br />

6. Click on the radio button next to Sampling Weight<br />

Variable.<br />

7. Click on the drop-down arrow <strong>for</strong> the Sampling<br />

weight variable: box and select hhwgt<br />

8. Click on the copy button, switch to the do-file<br />

editor, paste the command, switch back to the dialog<br />

box and click on Ok .<br />

The Stata command is:<br />

svyset cluster1 [pweight=hhwgt], strata(dist)<br />

vce(linearized) singleunit(missing)<br />

After running the command we see a summary of the<br />

command in the Results window:<br />

pweight: hhwgt<br />

VCE: linearized<br />

Single unit: missing<br />

Strata 1: dist<br />

SU 1: cluster1<br />

FPC 1: <br />

We can use the syvdesc command to look at the strata and<br />

PSU arrangement of the dataset.<br />

1. Click on Statistics then Survey data analysis<br />

2. Then click on Setup & utilities then Describe<br />

survey data<br />

<strong>11</strong>0

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

Saved successfully!

Ooh no, something went wrong!