list +-+Īs a general rule, computations involving missing values yield missing values. Therefore sum1 is missing for observations 2, 3, 4 and 7. If the value of any of those variables were missing, the value for sum1 was set to missing. The variable sum1 is based on the variables trial1, trial2 and trial3. The list command below illustrates how missing values are handled in assignment statements. It is important to understand how missing values are handled in assignment statements. For other procedures, see the Stata manual for information on how missing data are handled.Ĥ.If any of the variables listed after the reg command are missing, the observations missing that value(s) are excluded from the analysis (i.e., listwise deletion of missing data). This means that a different number of observations may be used in the calculation of the correlation coefficients for each pair of variables. The pwcorr command can be used to request that correlations be computed in a pairwise fashion, meaning that all of the available data for each pair of variables will be used to compute the correlation. If you use the missing option on the tab command, the percentages are based on the total number of observations (non-missing and missing) and the percentage of missing values are reported in the table.īy default, correlations are computed based on the number of rows with non-missing data for the variables listed after the corr command (listwise deletion of missing data). Summary of how missing values are handled in Stata proceduresįor each variable, the number of non-missing values are used.īy default, missing values are excluded and percentages are based on the number of non-missing values. pwcorr trial1 trial2 trial3, obs | trial1 trial2 trial3 As you can see, they differ depending on the amount of missing. ![]() We use the obs option to display the number of observation used for each pair. Correlations are displayed for the observations that have non-missing values for each pair of variables. Stata will perform listwise deletion and only display correlation for observations that have non-missing values on all variables listed. The output is show below. Note how the missing values were excluded. We would expect that it would perform the computations based on the available data and omit the missing values. Let’s look at how the correlate command handles missing data. tab1 trial1 trial2 trial3, m -> tabulation of trial1 This can be achieved by including the missing option (which can be shortened to m) after the tabulation command. It is possible that you might want the percentages to be computed out of the total number of observations, and the percentage missing for each variable shown in the table. tab1 trial1 trial2 trial3 -> tabulation of trial1 Note that the percentages are computed based on the total number of non-missing cases. Like summarize, tab1 uses just available data. +-Ī second example shows how the tabulation or tab1 command handles missing data. In short, the summarize command performed the computations on all the available data. summarize trial1 trial2 trial3Īs you see in the output below, summarize computed means using 4 observations for trial1 and trial2 and 6 observations for trial3. ![]() ![]() However, the way that missing values are omitted is not always consistent across commands, so let’s take a look at some examples.įirst, let’s summarize our reaction time variables and see how Stata handles the missing values. How Stata handles missing data in Stata proceduresĪs a general rule, Stata commands that perform computations of any type handle missing data by omitting the row with the missing values. The person measuring time for that trial did not measure the response time properly therefore, the data point for the second trial is missing. You might notice that some of the reaction times are coded using a single. We will illustrate some of the missing data properties in Stata using data from a reaction time study with eight subjects indicated by the variable id, and the subjects reaction times were measured at three time points (trial1, trial2 and trial3). It will describe how to indicate missing data in your raw data files, as well as how missing data are handled in Stata logical commands and assignment statements. This module will explore missing data in Stata, focusing on numeric missing data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |