Hello,
I am using sgplot to create a loess graph of grouped data. I have created an indicator variable that determines whether the association is above or below a pvalue of 0.05. I saw that there is a way to create a thickness response when making a series plot. However, I haven't gotten it to work when I am using a LOESS graph. Is there any way to do that? I have copied one of my attempts below.
proc sgplot data=compiled aspect=1 ; where &rank. & &hormone.; loess y=lsmean x=LSMeanNumber/group=metabolite markerattrs=(size=0) lineattrs=( thickresp= thickmax=7px) ; xaxis grid label="Rank" LABELATTRS=(family='Times New Roman' size=10) LABELATTRS=(family='Times New Roman' size=12) valueattrs=(family='Times New Roman' size=12pt); YAXIS grid label="ln(hormone) concentration" LABELATTRS=(family='Times New Roman' size=10) LABELATTRS=(family='Times New Roman' size=12 ) valueattrs=( family='Times New Roman' size=12pt) min=3.5 max=4.5; format metabolite summaryscore. hormone hormoneln.; styleattrs datacontrastcolors=(BIGB VIPB DELG VIRO STPPK VIYPK ); title " "; run;
You may be able to save the data output of the LOESS function from your code to an ODS output data set, and then use it for a SERIES plot with the THICKRESP=numeric-variable option to set line thickness by the p-value variable column. See other related options in doc to customize the output.
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!
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.