Winter 2005 Stat 89

Session 2 Instructions

1.  Login using your lab ID and your student ID

If you forgot:

2.  After you have logged on, double click to open the STATA icon.

3.  You will see four windows: Review, Variables, STATA results, and Command.

4.  You may want to resize the windows to fit the screen. To change the font size, you need to go to Preferences or Prefs.

Inputting data into Stata

1.  To begin, type

. edit

in the Command window and press enter. All STATA commands (written in bold type following the dot) will be typed in the Command window. STATA is line command oriented which makes it fast with lots of memory free for data. You must be careful to type each command exactly as writtten, but without the dot—the dot is just a STATA prompt indicator.

2.  Type in the raw data from our questionnaires. You can type a number and then hit the tab key to move across the screen. Notice that a “1” appears to mark the first case.

Give names to your variables

1.  After you type in the first case, rename the variables from their generic names (var_1, etc.) to our names. You do this by clicking on the cell with the number you have input.

2.  Up comes a box that allow you to put in the short variable name and a longer variable label that will be put on your output. It also allows you to change the formatting, but we don’t need to do that

Save your file

1.  When you have finished inputting all the data, then close the editor box

2.  You’ll now see your variables listed in the “Variables” window

3.  Be sure to save your data file by clicking on “File” in the upper left hand side and then saving your file with a dataset name. Leave the .dta extension on the file so that STATA will know that it’s a data file.

List your data

1.  Now take a look at your raw data. In the “Command” window type

.list

2.  Your data will appear in the “Results” window.

Exiting the STATA

1.  First you have to clear the data set from memory. In the “Command” window type

.clear

2.  Now exit STATA by typing

.exit