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 3 – Tables and other Types of Analysis<br />

The tabstat command<br />

4. For the egen function box, scroll down and highlight<br />

Row total .<br />

5. In the box <strong>for</strong> Generate variable as type: select<br />

integer<br />

6. Click on the egen function argument - Variables<br />

box type h64*<br />

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

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

click on Ok.<br />

The Stata command is:<br />

egen ncrops = rowtotal(h64*)<br />

Now you can do a frequencies on the new variable:<br />

tabulate ncrops<br />

Two households had increased sales on all crops (ncrop =<br />

8), 136 households had no increased sales on any of the<br />

crops (ncrop = 0).<br />

C. What is the distribution of the crops?<br />

For this question we can use the summarize command, but<br />

we could also use the tabstat command:<br />

1. From the menus click on Statistics.. then<br />

Summaries, tables & tests then Tables then<br />

Table of summary statistics (tabstat).<br />

2. Under the Main tab type h64* in the Variables: box<br />

3. Under “Statistics to display” place a tick in the<br />

first box and select Sum as the statistic.<br />

4. Under the Options tab in the Use as Columns<br />

change to Statistics.<br />

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

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

click on Ok .<br />

The Stata command is:<br />

tabstat h64*, statistics( sum ) columns(statistics)<br />

You see all the h64* variables with a count of the number<br />

of cases where yes was specified. Manioc (h64b) was the<br />

most frequent crop <strong>for</strong> which households had increased<br />

sales (<strong>11</strong>5), sorghum (h64g) was the least (14).<br />

2) Multiple response Multiple Response: The other type of multiple response<br />

question is where the survey question asks the respondent<br />

to "list up to xx choices" from a set of ten choices. If four<br />

96

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

Saved successfully!

Ooh no, something went wrong!