Hi
How should I code my probplot options in my proc univariate in order to get male/female distinct normal line ?
With my following code, I get only one normal line based on female statistics of BodyTemp.
ods graphics on/width=1000;
proc univariate data=Statdata.NormTemp;
var BodyTemp;
class Gender;
id ID;
histogram BodyTemp / NORMAL(color=blue) overlay;
probplot BodyTemp / NORMAL (mu=est sigma=est) overlay;
inset n='number of measurements recorded' mean median std='Standard Deviation' skewness kurtosis / position=ne;
title "Assessing normality of Body temperature (in celsius) by Gender";
run;
Thanks in advance for your help.
Laura B
Hello,
I would open a Technical Support track for this.
I notice the same (unexpected) behavior in below program (only one normal line instead of three).
I have also found this usage note , but it does not solve your problem :
Usage Note 24299: Plotting more than one theoretical distribution on one graph
https://support.sas.com/kb/24/299.html
* If you have several variables you want to overlay,
first reshape the data set to stack the vars and create a CLASS or indicator variable;
data one;
do i=1 to 25;
a=rannor(32409);
b=2+1.5*rannor(32409);
c=ranuni(32409);
output;
end;
drop i;
run;
* add a unique var (if you don't already have one in the data set) to use in PROC TRANSPOSE;
data one;
set one;
id=_n_;
run;
proc transpose data=one out=two(rename=(_NAME_=Source Col1=Measure) drop=ID);
by ID;
run;
ods listing close;
ods html;
ods graphics on;
proc univariate data=two noprint;
label source=;
class source;
var measure;
probplot measure/ NORMAL (mu=est sigma=est) overlay;
qqplot measure/ overlay;
cdfplot measure/ overlay;
run;
/* end of program */
Cheers,
Koen
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.