.- help for ^pattern^ (STB-33: sed2.1) .- Update to pattern ----------------- ^pattern^ varlist [^if^ exp] [^in^ exp] [, ^d^etail ] Description ----------- Shows the frequency and pattern of missingness for the variables in the varlist. In the pattern, there will be one ^column^ for each variable (in the order called in the command), and the column will have either a ^.^ or an ^X^. The ^.^ means that the variable is missing and the ^X^ means it is not missing. The column headed ^COUNT^ gives the frequency of that pattern, the column headed ^PCT^ gives the percentage of total observations that have that pattern, and the column headed ^PATTERN^ gives the pattern. At the bottom the total number of observations is given. Thus, in the first example below, there are 5 observations (out of 74, or 6.76%) that are missing the last variable checked: rep78. Note that the last row of the pattern will be those observations that have no missing values (if there are any such observations). The counter on the far left counts the number of patterns found. A maximum of 55 variables is allowed (so that the pattern will show cleanly on the screen). You may use string variables, numeric variables, or a mixture of string and numeric variables. ^if^ and ^in^ can be used either to check for patterns while excluding one (or more) observation(s) that have numerous missing values or to produce patterns for different subsets of the data to compare the pattern in, e.g., the treatment and control groups, or for males and for females, etc. See the examples below. Options ------- ^detail^ shows the number of missing values for each variable in varlist; since it also shows the name of the variable it may be useful to remind one of the order of the variables. If you intend to use impute, or some other imputation method, the number of missing values for each variable may be useful in determining the order in which you choose the variables to be imputed (imputing variables with fewer missing values prior to imputing other variables may be helpful). Examples -------- . ^use auto^ (1978 Automobile Data) . ^pattern price-rep78^ COUNT PCT PATTERN 1. 5 6.76 XX. 2. 69 93.24 XXX Total: 74 . ^pattern make-rep78, d^ 0 missing values for variable make 0 missing values for variable price 0 missing values for variable mpg 5 missing values for variable rep78 COUNT PCT PATTERN 1. 5 6.76 XXX. 2. 69 93.24 XXXX Total: 74 . ^pattern _all^ COUNT PCT PATTERN 1. 5 6.76 XXX.XXXXXXXX 2. 69 93.24 XXXXXXXXXXXX Total: 74 . ^pattern _all if _n>2^ COUNT PCT PATTERN 1. 5 6.94 XXX.XXXXXXXX 2. 67 93.06 XXXXXXXXXXXX Total: 72 . ^pattern _all in 2/l^ COUNT PCT PATTERN 1. 5 6.85 XXX.XXXXXXXX 2. 68 93.15 XXXXXXXXXXXX Total: 73 . ^pattern _all if foreign==0^ COUNT PCT PATTERN 1. 4 7.69 XXX.XXXXXXXX 2. 48 92.31 XXXXXXXXXXXX Total: 52 . ^pattern _all if foreign==1^ COUNT PCT PATTERN 1. 1 4.55 XXX.XXXXXXXX 2. 21 95.45 XXXXXXXXXXXX Total: 22 Author ------ Richard Goldstein Qualitas, Inc. richgold@@netcom.com Also See -------- STB: STB-33, sed2.1 On-line: help @impute@, help @codebook@