Published on :
Statistics SASHELP

Documentation Example 19 for PROC MI

This code is also available in: Deutsch Español Français
This SAS© script uses PROC MI to analyze missing data patterns and configure a multiple imputation process on the `sashelp.heart` dataset. It also includes a PROC PRINT to display the first 10 observations of the dataset. The ODS system is configured to select specific outputs and enable graphics. The MI procedure is configured for the 'flux' model with `nimpute=0`, a pattern display without means, and all character variables are defined as class variables.
Data Analysis

Type : SASHELP


The script uses the internal `sashelp.heart` dataset from the SASHELP library.

1 Code Block
PROC PRINT
Explanation :
This block uses PROC PRINT to display the first 10 observations of the `sashelp.heart` dataset. This allows for a quick check of the data structure and content before the imputation analysis.
Copied!
1PROC PRINT DATA=sashelp.heart(obs=10);
2RUN;
2 Code Block
ODS
Explanation :
This block configures the Output Delivery System (ODS). It selects specific output objects (`MissPattern`, `Flux`, `FluxPlot`, `Corr`) that will be generated by the MI procedure, and enables ODS graphics, allowing for the creation of visualizations thereafter.
Copied!
1ods select MissPattern Flux FluxPlot Corr;
2ods graphics on;
3 
3 Code Block
PROC MI
Explanation :
This block executes the multiple imputation procedure (PROC MI). It is applied to the `sashelp.heart` dataset. The options `simple flux nimpute=0 displaypattern=nomeans` are used to analyze missing data patterns (`simple`), specify the flux imputation method (`flux`), but without generating imputations (`nimpute=0`), and display the missing data pattern without means (`displaypattern=nomeans`). `class _character_` declares all character variables as class variables, `var _all_` includes all variables in the analysis, and `fcs` specifies the use of the 'Fully Conditional Specification' method for imputation.
Copied!
1PROC MI DATA=sashelp.heart SIMPLE flux nimpute=0
2 displaypattern=nomeans;
3 class _character_;
4 var _all_;
5 fcs;
6RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : SAS SAMPLE LIBRARY