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

Describing the contents of a<br />

data file:<br />

The describe command<br />

* define the log file to capture output<br />

* name of log file is “log_session1”<br />

capture log close<br />

log using log_session1, replace<br />

/* Purpose of do-file */<br />

/* Author and date */<br />

/* Tasks to be done in this do-file */<br />

/*program setup */<br />

version <strong>11</strong><br />

clear all<br />

macro drop _all<br />

6. Save the do-file. From the File menu in Do-File<br />

Editor select Save As...<br />

7. Enter the filename session1<br />

The .do extension will be added to the name<br />

automatically.<br />

8. Click on Save.<br />

The do-file is now saved to disk.<br />

We need to run all the commands from the do-file to start<br />

the log and record the commands in the log file. Block all<br />

the commands and click on the Do button<br />

We have opened the household-member data file which is<br />

now the current file in memory. Stata only allows one file<br />

to be open at a time.<br />

A key piece of in<strong>for</strong>mation we need to know about a data<br />

file is what variables it contains. We can find this out,<br />

along with other in<strong>for</strong>mation, by using the Describe data<br />

command on the Data menu:<br />

1. From the Data menu select Describe data...<br />

2. There are several choices under this option: Select<br />

Describe data in memory. A dialog box opens:<br />

There are several options in this dialog box.<br />

21

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

Saved successfully!

Ooh no, something went wrong!