Using Stata for Survey Data Analysis


Download 1.39 Mb.
Pdf ko'rish
bet23/61
Sana08.03.2023
Hajmi1.39 Mb.
#1252470
1   ...   19   20   21   22   23   24   25   26   ...   61
Bog'liq
2009 Usingstataforsurveydataanalysis (1)

Minot
 
 
 
 
 
Using Stata for Survey Analysis 
Page 18 
 

Edit/Undo, Do, and Run. Probably the button you will use most is the third-to-last one that shows a 


page with text on it. This is the “Do” button for executing the program or the marked part of the 
program. 
Finally, many of the keyboard commands in MS Word work in the Do-file Editor. For example, 
control-Z to undo, control-C to copy, control-V to paste, control-X to delete, and control-F to find.
To run the commands in a Do-file, you can click on the Do button (the third-to-last one) or click on 
Tools/Do. If you want to run one or just a few commands rather than the whole file, mark the 
commands and click on the Do button. You do not have to mark the whole command, but at least one 
character in the command must be marked in order for the command to be executed (unlike SPSS, it is 
not enough to have the cursor on a command).
Although layout is a matter of personal preference, it may be useful to have the Results window and 
the other windows on one side of the screen and the Do-file Editor window on the other. This makes 
it easy to switch back and forth. When you arrange the windows the way you like, you can save the 
layout by clicking Prefs/Manage Preferences/Save Preferences. Each time you open Stata, it will use 
your chosen layout.
 
Saving the output 
As mentioned in Section 3, the Stata Results window does not automatically keep all the output you 
generate. It only stores about 300-600 lines, and when it is full, it begins to delete the old results as 
you add new results. You can increase the amount of memory allocated to the Stata Results window 
(see “set scrollbufsize” in Section 3), but even this will probably not be enough for a long session with 
Stata. Thus, we need to use log to save the output.
There are several different ways to control the log operations. 
 
You can use the “Brown book” button on the tool bar.
 
You can click on File/Log to begin or close a log file (Suspend and Resume are to temporarily 
turn off and on the log).
 
You can use “log” commands in the Command window 
 
You can use “log” commands in a Do-file. 
In this section, we describe the commands, which can be used in the Stata Command window or in a 
do-file (program).
log using 
This command creates a file with a copy of all the commands and output from Stata. The first time 
you open a log, you must give a name to the new file to be created. The syntax is: 

Download 1.39 Mb.

Do'stlaringiz bilan baham:
1   ...   19   20   21   22   23   24   25   26   ...   61




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling