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

Appending Data

Оглавление

As an example of the first combination scenario, consider that the current 10 cases were the first set of respondents who completed your survey. You may have begun your analyses assuming that these cases were the only ones who had decided to respond to the survey. But, as is often the case, after a few more weeks you notice that 10 new respondents submitted their survey information. You would of course want to include these tardy completers in your final analyses.

In this scenario, you would have a second data set of these 10 new cases, and it would look like that presented in Figure 1.8.


FIGURE 1.8 • NEW OBSERVATIONS WITH SIMILAR VARIABLES

As you can see, these new data contain the exact same variables as the original data, but the set has 10 new respondents, which is indicated by their 10 unique ids values. The type of data combination you would want to conduct in this situation is referred to as “appending” in Stata because you are adding new cases to an existing data set. Therefore the command to complete this data combination is –append-. Again, for the specifics of how to complete this command, see the Stata Help Files section of Chapter 8 to learn how to use the help file to teach yourself the full details of the –append- process. But to help you see what the end product is, Figure 1.9 displays what the data would look like if you used the –append- command to join the two example data sets.


FIGURE 1.9 • NEW APPENDED DATA SET

You can see that the new data set now contains 20 cases, which are the original 10 respondents plus the 10 more recent survey completers, and each has information on all of the same variables.

Using Stata for Quantitative Analysis

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