BookmarkSubscribeRSS Feed
jojo
Obsidian | Level 7

 anyone used proc MI for longitudinal data in long format before?

 

data da;

 input id$ visitn trt val;

data lines;

001 1 A 32

001 2 A 29

001 3 A 25

001 4 A 30

001 5 A 22

002 1 A .

002 2 A 20

002 3 A .

002 4 A 18

002 5 A 28

003 1 A  15

003 2 A 10

003 3 A .

003 4 A 18

003 5 A 18

004 1 B 15

004 2 B 17

004 3 B 20

004 4 B 18

004 5 B .

005 1 B 16

005 2 B 14

005 3 B 20

005 4 B .

005 5 B .

006 1 B  19

006 2 B 17

006 3 B 20

006 4 B .

006 5 B 18

;

run;

 

 

proc mi data=da nimpute=50 out=da1;

mcmc chain=multiple;

var visitn val;

by id;

run;

 

 

1 REPLY 1
SAS_Rob
SAS Employee

The long format is not usually compatible with performing  multiple imputation, thus data restructuring from long to wide or the reverse is often needed for multiple imputation.  There is a good discussion in Raghunathan's Missing Data in Practice text (2016) pages 121-126 and in the 2018 paper linked below.

Using SAS for Multiple Imputation and Analysis of Longitudinal Data

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
  • 660 views
  • 4 likes
  • 2 in conversation