Data visualization with SAS programming

How can I make Predicted Mean Graph with 90%CI Using PROC MIXED?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

How can I make Predicted Mean Graph with 90%CI Using PROC MIXED?

Hi, All:

 

 

I'm trying to investigate clinical trial data by Linear Mixed-Effects Modeling and I want to make Predicted Mean Graph with 90%CI, which is like attached picture (Plots are not needed). 

I started hunting and got following ideas, but I haven't reached clear one yet, and they are like difficult ones to understand. If you have easier ideas, advice, reference documents and so on, please let me know. Thank you for your kind cooperation.

LikeThis.PNG

Ideas I reached are following.....

No. 1: Use OUTP= option in MODEL Statement of PROC MIXED -> Use SGPLOT (I couldn't get wanted one.)

No. 2: PROC MIXED or PROC GLIMMIX -> PROC PLM (difficult one? less information)

/* For Example, I want to make graph by using information in Output "Solution for Fixed Effects" */
data hospital;
    input hospital physician x y @@;
    datalines;
    1 1 19.4 32.4 1 1 19.3 28.3 1 1 19.2 31.9
    1 2 18.8 18.9 1 2 18.4 20.3 1 2 18.2 21.3
    1 3 19.7 24.8 1 3 20.4 38.6 1 3 20.2 27.4
    1 4 19.3 36.1 1 4 21.7 32.4 1 4 20.8 30.7
    2 1 21.5 31.3 2 1 18.7 28.5 2 1 19.9 20.1
    2 2 18.9 31.8 2 2 18.7 25.1 2 2 19.5 32.9
    2 3 18.7 18.3 2 3 19.4 27.4 2 3 19.5 26.2
    2 4 20.9 28.6 2 4 21.1 29.9 2 4 20.0 16.4
    ;
run;
proc mixed data=hospital;
    class hospital physician;
    model y=x / ddfm=kr solution;
    random int / subject=physician(hospital);
run;

Thank you.


Accepted Solutions
Solution
2 weeks ago
SAS Super FREQ
Posts: 4,110

Re: How can I make Predicted Mean Graph with 90%CI Using PROC MIXED?

[ Edited ]
Posted in reply to KentaMURANAKA

You have to use the OUTPM= option on the MODEL statement to get the predicted means. Otherwise, the band and fitted values will be based on the individual predictions.

 

proc mixed data=hospital alpha=0.1;
    class hospital physician;
    model y=x / ddfm=kr solution outpm=Predicted;
    random int / subject=physician(hospital);
run;

proc sort data=Predicted; by x; run;

proc sgplot data=Predicted;
band x=x lower=Lower upper=Upper / legendlabel="90% CLM";
series x=x y=pred;
scatter x=x y=y;  
run;

 

View solution in original post


All Replies
Super User
Posts: 13,023

Re: How can I make Predicted Mean Graph with 90%CI Using PROC MIXED?

Posted in reply to KentaMURANAKA

Your first step would likely be to set the option Alpha=0.1 to create 90% confidence intervals. The default for Alpha is 0.05 creating 95% intervals.

 

Note that "couldn't get wanted one" does not clarify why you did not get the one you wanted. What was wrong, other than a likely Alpha related issue?

Solution
2 weeks ago
SAS Super FREQ
Posts: 4,110

Re: How can I make Predicted Mean Graph with 90%CI Using PROC MIXED?

[ Edited ]
Posted in reply to KentaMURANAKA

You have to use the OUTPM= option on the MODEL statement to get the predicted means. Otherwise, the band and fitted values will be based on the individual predictions.

 

proc mixed data=hospital alpha=0.1;
    class hospital physician;
    model y=x / ddfm=kr solution outpm=Predicted;
    random int / subject=physician(hospital);
run;

proc sort data=Predicted; by x; run;

proc sgplot data=Predicted;
band x=x lower=Lower upper=Upper / legendlabel="90% CLM";
series x=x y=pred;
scatter x=x y=y;  
run;

 

Occasional Contributor
Posts: 16

Re: How can I make Predicted Mean Graph with 90%CI Using PROC MIXED?

Dear ballardw & Rick:

 

 

Thank you for your reply and I'm so sorry for confusing you with insufficient information.

Like Mr. Rick said, I used OUTP= option and I got data based on the individual predictions, so I was confused.

 

Now, I accomplished my objective.

Thank you so much.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 119 views
  • 3 likes
  • 3 in conversation