The MI Procedure

Example 76.1 EM Algorithm for MLE

(View the complete code for this example.)

This example uses the EM algorithm to compute the maximum likelihood estimates for parameters of multivariate normally distributed data with missing values. The following statements invoke the MI procedure and request the EM algorithm to compute the MLE for of a multivariate normal distribution from the input data set Fitness1:

proc mi data=Fitness1 seed=1518971 simple nimpute=0;
   em itprint outem=outem;
   var Oxygen RunTime RunPulse;
run;

Note that when you specify the NIMPUTE=0 option, the missing values are not imputed.

The "Model Information" table in Output 76.1.1 describes the method and options used in the procedure if a positive number is specified in the NIMPUTE= option.

Output 76.1.1: Model Information

The MI Procedure

Model Information
Data SetWORK.FITNESS1
MethodMCMC
Multiple Imputation ChainSingle Chain
Initial Estimates for MCMCEM Posterior Mode
StartStarting Value
PriorJeffreys
Number of Imputations0
Number of Burn-in Iterations200
Number of Iterations100
Seed for random number generator1518971


The "Missing Data Patterns" table in Output 76.1.2 lists distinct missing data patterns with corresponding frequencies and percentages. Here, a value of "X" means that the variable is observed in the corresponding group and a value of "." means that the variable is missing. The table also displays group-specific variable means.

Output 76.1.2: Missing Data Patterns

Missing Data Patterns
GroupOxygenRunTimeRunPulseFreqPercentGroup Means
OxygenRunTimeRunPulse
1XXX2167.7446.35381010.809524171.666667
2XX.412.9047.10950010.137500.
3X..39.6852.461667..
4.XX13.23.11.950000176.000000
5.X.26.45.9.885000.


With the SIMPLE option, the procedure displays simple descriptive univariate statistics for available cases in the "Univariate Statistics" table in Output 76.1.3 and correlations from pairwise available cases in the "Pairwise Correlations" table in Output 76.1.4.

Output 76.1.3: Univariate Statistics

Univariate Statistics
VariableNMeanStd DevMinimumMaximumMissing Values
CountPercent
Oxygen2847.116185.4130537.3880060.0550039.68
RunTime2810.688211.379888.6300014.0300039.68
RunPulse22171.8636410.14324148.00000186.00000929.03


Output 76.1.4: Pairwise Correlations

Pairwise Correlations
 OxygenRunTimeRunPulse
Oxygen1.000000000-0.849118562-0.343961742
RunTime-0.8491185621.0000000000.247258191
RunPulse-0.3439617420.2472581911.000000000


When you use the EM statement, the MI procedure displays the initial parameter estimates for the EM algorithm in the "Initial Parameter Estimates for EM" table in Output 76.1.5.

Output 76.1.5: Initial Parameter Estimates for EM

Initial Parameter Estimates for EM
_TYPE__NAME_OxygenRunTimeRunPulse
MEAN 47.11617910.688214171.863636
COVOxygen29.30107800
COVRunTime01.9040670
COVRunPulse00102.885281


When you use the ITPRINT option in the EM statement, the "EM (MLE) Iteration History" table in Output 76.1.6 displays the iteration history for the EM algorithm.

Output 76.1.6: EM (MLE) Iteration History

EM (MLE) Iteration History
_Iteration_-2 Log LOxygenRunTimeRunPulse
0289.54478247.11617910.688214171.863636
1263.54948947.11617910.688214171.863636
2255.85131247.13908910.603506171.538203
3254.61642847.12235310.571685171.426790
4254.49497147.11108010.560585171.398296
5254.48397347.10652310.556768171.389208
6254.48292047.10489910.555485171.385257
7254.48281347.10434810.555062171.383345
8254.48280147.10416510.554923171.382424
9254.48280047.10410510.554878171.381992
10254.48280047.10408610.554864171.381796
11254.48280047.10407910.554859171.381708
12254.48280047.10407710.554858171.381669


The "EM (MLE) Parameter Estimates" table in Output 76.1.7 displays the maximum likelihood estimates for and of a multivariate normal distribution from the data set Fitness1.

Output 76.1.7: EM (MLE) Parameter Estimates

EM (MLE) Parameter Estimates
_TYPE__NAME_OxygenRunTimeRunPulse
MEAN 47.10407710.554858171.381669
COVOxygen27.797931-6.457975-18.031298
COVRunTime-6.4579752.0155143.516287
COVRunPulse-18.0312983.51628797.766857


You can also output the EM (MLE) parameter estimates to an output data set with the OUTEM= option. The following statements list the observations in the output data set Outem:

proc print data=outem;
   title 'EM Estimates';
run;

The output data set Outem in Output 76.1.8 is a TYPE=COV data set. The observation with _TYPE_=‘MEAN’ contains the MLE for the parameter , and the observations with _TYPE_=‘COV’ contain the MLE for the parameter of a multivariate normal distribution from the data set Fitness1.

Output 76.1.8: EM Estimates

EM Estimates

Obs_TYPE__NAME_OxygenRunTimeRunPulse
1MEAN 47.104110.5549171.382
2COVOxygen27.7979-6.4580-18.031
3COVRunTime-6.45802.01553.516
4COVRunPulse-18.03133.516397.767