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

Entering Your Own Data

Оглавление

Many data files you analyze will already be in Stata format or in a format that can be easily converted to Stata format (more on this topic below). Yet there may be times when you need to enter the data from a study. For example, if you distributed a survey through the mail, you will need to input the responses to each question for each case so that you can analyze them in Stata.

The first step in entering your own data after you have opened Stata is to open the Data Editor window as above. From here you can simply enter the values for each case on each variable. Entering data in this way is very similar to entering values into a Microsoft Excel file. The Data Editor, however, does not have the equation functionalities that an Excel file would.

When you begin entering values, each variable is automatically named var1, var2, and so on. Most often, it is helpful to have the variable names be more descriptive of the values they contain. One way to change these generic names to something that more clearly identifies the variable is to click on the current name of the given variable you want to rename (e.g., var1) listed near the top of the Editor window. Doing so will bring up that variable’s information in the Properties window (inside the Data Editor window). Then click on the current variable name listed in the Name blank in that Properties window. From there you can simply delete the current name and enter the desired name. Another option would be to close the Data Editor window when you have finished entering all of the data. Then you can click on the variable name (e.g., var2) in the Variables window, which will bring up that variable’s information in the Properties window. To change the name in this Properties window, you will need to click on the padlock icon in the Properties window. Then you will need to click on the current variable name listed in the Name blank and simply type the new name in the blank.

Once you have finished entering all your data, close the Data Editor and follow the steps described above to save a copy of your data file in Stata format.

Using Stata for Quantitative Analysis

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