BookmarkSubscribeRSS Feed
VioletaB
Calcite | Level 5

Hello,

 

I want to use proc mi to impute missing data and i have following question:

In the code below i have in the var statement 2 categorical variables with no missing values and continuous variables that have missing data. 

 

proc mi data=data1 seed=38467 nimpute=50 out=data_mcmc;

  mcmc impute=monotone chain=multiple;

var treatment gender calcium_v1 calcium_v2 calcium_v3...calcium_v20;

run; 

 

In this case do i have to include 'by' statement with these 2 categorical variables OR create a dummy variable (0,1) for each category OR no updates are needed in this case? 

1 REPLY 1
SAS_Rob
SAS Employee

If you are going to use the MCMC statement then you will need to create dummy variables for the categorical variables. 

Unless you have a specific reason for doing so, you could avoid having to impute in two steps by simply using the FCS statement.  This would enable you to use the CLASS statement and avoid having to dummy code.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1198 views
  • 0 likes
  • 2 in conversation