The script first creates a dataset named 'Fitness1' containing fitness measurements (oxygen consumption, run time, resting pulse) with arbitrarily introduced missing values. Then, the `PROC MI` procedure is used with an MCMC (Markov Chain Monte Carlo) method to generate multiple imputations for these missing data. The result is stored in a new dataset 'outmi'. Finally, the first 10 observations of the imputed dataset are displayed for verification.
Data Analysis
Type : INTERNAL_CREATION
Data are created directly in the script via a DATA step with the `datalines` statement. The 'Fitness1' dataset contains fitness measurements.
1 Code Block
DATA STEP Data
Explanation : This code block creates the 'Fitness1' table. It reads data directly embedded in the program using the 'datalines' statement. The '@@' formatting specifier is used in the INPUT statement to indicate to SAS that multiple observations can be on the same data line.
Explanation : This procedure performs multiple imputation on the 'Fitness1' dataset. The 'seed' option initializes the random number generator for reproducibility. The 'mu0' option specifies the initial means for the imputation algorithm. The 'mcmc' statement invokes the Markov Chain Monte Carlo method. The variables 'Oxygen', 'RunTime', and 'RunPulse' are specified for imputation. The result is saved in the 'outmi' table.
Copied!
proc mi data=Fitness1 seed=501213 mu0=50 10 180 out=outmi;
mcmc;
var Oxygen RunTime RunPulse;
run;
Explanation : This block displays the first 10 rows (obs=10 option) of the 'outmi' dataset, which contains the values imputed by PROC MI. A title is added to clarify the output.
Copied!
proc print data=outmi (obs=10);
title 'First 10 Observations of the Imputed Data Set';
run;
1
2
PROC PRINT
3
DATA=outmi (obs=10);
4
title 'First 10 Observations of the Imputed
5
Data Set';
6
RUN;
7
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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.