Читать книгу Using Stata for Quantitative Analysis - Kyle C. Longest - Страница 16

A CLOSER LOOK: YOUR FIRST COMMAND

Оглавление

You may have noticed that when you changed the first case’s value using the Data Editor window, the following text was displayed in the Results window:

replace agecats = 22 in 1

(1 real change made)

Whenever you use the menus or a point-and-click method for performing an operation in Stata, it displays in the Results and Review window the command that would be entered in the Command window to perform the same operation. In this Data Editor example, you can see that the command to change a value is -replace-. If you had entered this full command into the Command window and pressed Enter, the same change would have been made. At times, it may be helpful to perform an operation for the first time using the menus, but, as will be discussed in much more detail in Chapter 2, it is extremely beneficial to know and use the commands via the Command window for the majority of the operations you need to perform.

The rest of this book will discuss how to perform operations using the Command window. But to see the connection between the menu-based operation and the Command window, try this: Type (or copy and paste) the full command (except the first “.”) that was displayed in the Results window when you closed the Data Editor window into the Command window. Now change the “22” to “23.” The command should read

replace agecats = 23 in 1

Then press Enter. Open the Data Browser window again and notice the change to the first case’s value under agecats.

Using Stata for Quantitative Analysis

Подняться наверх