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

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

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

Stata <strong>11</strong> Sample Session Section 3 – Tables and other Types of Analysis<br />

Tables<br />

<strong>STATA</strong> <strong>11</strong> <strong>SAMPLE</strong> <strong>SESSION</strong><br />

SECTION 3 – Tables and Other Types of Analysis<br />

Using the Table command you can calculate various<br />

statistics and present them in a variety of ways that are<br />

completely under your control. Table allows you to<br />

choose how you want to assemble variables and statistics<br />

<strong>for</strong> display in rows, columns, and super-columns or<br />

super-rows. A super-column or super-row has a variable<br />

nested below it. Variables can be stacked or nested.<br />

Nested means that all of the values <strong>for</strong> one variable are<br />

displayed below the individual values of another variable.<br />

You can manipulate table structure, content, and<br />

presentation <strong>for</strong>mat.<br />

With this command there a few limitations:<br />

a) up to 4 variables can be specified in the by()<br />

b) up to 5 statistics can be displayed in each cell<br />

c) the sum of the number of rows, columns, supercolumns,<br />

and super-rows is called the number of margins.<br />

A table may contain up to 3000 margins, e.g. a one-way<br />

table may contain 3000 rows, a two-way table may<br />

contain 2998 rows and 2 columns, or 2997 rows and 3<br />

columns and so <strong>for</strong>th<br />

Commands that produce similar results are:<br />

tabstat - displays summary statistics <strong>for</strong> a series of<br />

numeric variables in a single table<br />

tabsum - produces one- and two-way tables of<br />

means and standard deviations - this<br />

command is faster, but the table command<br />

is more flexible<br />

tabulate - one- and two-way tables of frequencies<br />

tab1 produces one-way tabulation <strong>for</strong> each<br />

variable<br />

tab2 produces two-way tabulations of all<br />

combinations of the variables<br />

Let's compare the tabulate command with the table<br />

command to create two-way tables.<br />

Create a do-file with all the proper commands at the<br />

beginning of the do-file. Refer to the do files you have<br />

already created. You can copy several of the commands<br />

that you need and comments. Remember to start the log<br />

file <strong>for</strong> this session.<br />

Open the member file we created from Section 1 that<br />

contains the age variable, q1a-age.dta.<br />

88

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

Saved successfully!

Ooh no, something went wrong!