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 1 - Basic functions: Files, Descriptives, Data Trans<strong>for</strong>mations<br />

This would tell you, <strong>for</strong> example, how many females are<br />

The tabulate command<br />

heads of households. The Tabulate command will<br />

produce this type of summary. Make the household<br />

member file, c-q1a.dta, the working data file.<br />

1. Click on the yellow open folder tool at the top left<br />

of the Toolbar<br />

2. Select the file c-q1a.dta.<br />

3. Click on Open to open the file.<br />

4. Copy the command <strong>for</strong> opening the file which<br />

appears in the Results window, into the Do-file<br />

Editor window.<br />

Reminder: You should add comments to your do-file so<br />

that you can remember what and why you were doing<br />

specific commands when you developed the do-file.<br />

Several days or weeks from now you may not remember.<br />

Comments in a do-file start with slash and then an<br />

asterisk and end with an asterisk and a slash:<br />

/* this is a comment<br />

which runs to two lines */<br />

Stata will not run multiple lines as a command if it begins<br />

with these symbols.<br />

To create a two-way table do the following:<br />

1. From the menus click on<br />

Statistics..<br />

Summaries, Tables & Tests<br />

Tables<br />

Two-way tables with measures of association<br />

The Tabulate2 - two-way tables dialog box opens.<br />

2. In the Row Variable box choose ca2 from the dropdown<br />

choices.<br />

3. In the Column Variable box choose ca4 from the<br />

drop-down choices.<br />

We would like to see row percentages and column<br />

percentages.<br />

4. Under Cell Contents click in the box next to<br />

Within column relative frequencies to put a ✓.<br />

5. Click in the box ✓ next to Within row relative<br />

frequencies.<br />

6. Click on the copy button, switch to the Do-File<br />

Editor and paste the command. Write a comment<br />

and then switch back to the dialog box to click on<br />

the Submit button. The command will be<br />

37

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

Saved successfully!

Ooh no, something went wrong!