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 ...
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 0 – File structure and Basic Operations <strong>for</strong> Stata <strong>11</strong><br />
Exercise: Exercise: Change the value to 1 in the hh column where hh=2.<br />
Clicking on Yes, will change the value, No will cancel out. If<br />
you switch back to the Stata window, you will see a command<br />
that has been run that replaces the value. Now switch back to<br />
the data editor.<br />
By default the value labels are displayed. To look at the<br />
values, on the table and choose “Hide all Value<br />
Labels”.<br />
Another option available with the is to Manage<br />
Value Labels where a value label can be defined, dropped or<br />
added. We will discuss later value labels when we create new<br />
variables.<br />
A description of all the variables is also available within the<br />
Data editor. Click on Data, Variable Manager. Or click<br />
on the icon . You can see a list of all the variables with the<br />
details <strong>for</strong> each variable.<br />
Exiting the Data Editor To exit the Data Editor, click on the “x” in the upper right<br />
hand corner of the Data Editor. The window closes.<br />
Saving the Stata Data File<br />
The save, replace command<br />
You will often get a data file, compute new variables, make<br />
trans<strong>for</strong>mations, and finally save the modified set of data to a<br />
new name to be used at another time. For example: you might<br />
retrieve a data file with land area per crop, add to it production<br />
per crop from another file, and then calculate yield. If you<br />
want to use the new production and yield variables at a later<br />
time, you must make sure that the data file is saved with the<br />
new variables in it. Never save data that has been modified to<br />
the same file name unless these are permanent changes to be<br />
made to the original data set.<br />
We do not want to save any changes that were made to this<br />
data file. Below are instructions on how to save the file if you<br />
wanted save the data file. You can close the Data Editor or<br />
you can also save the file within the Data Editor.<br />
From the menus select<br />
File, Save As... and enter the name.<br />
From the Command window, you can also type<br />
save “newfilename”<br />
or, if you want to use the same name, type<br />
save, replace<br />
15