BookmarkSubscribeRSS Feed
superbibi
Obsidian | Level 7

Hi, 

 

I have a sample dataset for multiple imputation and I will use proc mianalyze. 

 

I encounter two problems:

 

1. When visit 2 has no missing, the outcome of proc mianalyze does not show the p-values.

2. How can I get the adjusted p-values from proc mianalyze procedure. 

 

DATA FORMI (keep=person gender y1-y4)
formixed(keep=person gender visit y);
input person gender$ y1-y4;
output FORMI;

datalines;
1 F 21.0 20.0 21.5 .
2 F 21.0 21.5 24.0 25.5
3 F 20.5 24.0 24.5 26.0
4 F 23.5 24.5 25.0 26.5
5 F 21.5 23.0 22.5 23.5
6 F 20.0 21.0 21.0 .
7 F 21.5 22.5 23.0 25.0
8 F 23.0 23.0 23.5 24.0
9 F 20.0 21.0 22.0 21.5
10 F 16.5 19.0 19.0 19.5
11 F 24.5 25.0 28.0 28.0
12 M 26.0 25.0 29.0 31.0
13 M 21.5 22.5 23.0 26.5
14 M 23.0 22.5 . 27.5
15 M 25.5 27.5 26.5 27.0
16 M 20.0 23.5 22.5 26.0
17 M 24.5 25.5 27.0 28.5
18 M 22.0 22.0 . 26.5
19 M 24.0 21.5 24.5 25.5
20 M 23.0 20.5 31.0 26.0
21 M 27.5 28.0 31.0 31.5
22 M 23.0 23.0 23.5 25.0
23 M 21.5 23.5 24.0 28.0
24 M 17.0 24.5 26.0 29.5
25 M 22.5 25.5 25.5 26.0
26 M 23.0 24.5 26.0 30.0
27 M 22.0 21.5 23.5 25.0
;

data formixed2;
set formixed;
by person;
if first.person then base = y;
base +0;
diff = y - base;
output;
run;



PROC MI DATA = FORMI OUT = MI1 SEED=21355417 NIMPUTE=10 ;
FCS ;
MNAR;
VAR Y1 Y2 Y3 Y4 ;
RUN;

DATA MI1;
SET MI1;
BVAL = Y1;
RUN;


PROC SORT DATA = MI1;
BY _IMPUTATION_ PERSON BVAL;
RUN;

PROC TRANSPOSE DATA = MI1 OUT = MIX1 NAME = VISIT ;
BY _IMPUTATION_ PERSON BVAL ;
VAR Y1 Y2 Y3 Y4  ;
RUN;

PROC MIXED DATA = MIX1;
BY _IMPUTATION_;
CLASS PERSON VISIT;
MODEL COL1 = BVAL VISIT;
REPEATED VISIT/TYPE =AR(1) SUBJECT = PERSON;
LSMEANS VISIT/PDIFF ADJUST = DUNNETT;
ODS OUTPUT DIFFS = DIFFS;
RUN;


PROC SORT DATA = DIFFS;
BY  VISIT  _IMPUTATION_;
RUN;


PROC MIANALYZE  DATA = DIFFS ;
BY  VISIT  ;
MODELEFFECTS ESTIMATE;
STDERR STDERR;
ODS OUTPUT PARAMETERESTIMATES  = PARAMETERESTIMATES;
RUN;



 

1 REPLY 1

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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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