I will like to replicate this graph and knowing the types of code to use. Most importantly, I will like to know which sas code will produce the darker line under the mean telomere length.
What does the graph represent?
The "heavy line" at the bottom of the graph is referred to as a FRINGEPLOT and is on of the plot statements in the SAS Graph Template Language. A NEEDLE plot with appropriate data can also make something like that.
Do you have the full document that link references? If you are looking for code to do the same regression then we need to know the exact regression they did and possibly even code used as there are lots of options for regressions and guessing won't help you much.
The full paper might even include how the graph was made.
The first step would be getting the data needed for the plot.
SGPLOT with SERIES statements for the lines and a NEEDLE statement for the spikes at the bottom.
Here's a good intro tutorial.
https://support.sas.com/resources/papers/proceedings10/154-2010.pdf
Not sure if you want the needles on the same axis or a different axis, so I'm including an example with it on a secondary axis. If you don't want it on a secondary axis remove anything related to the Y2AXIS statements.
proc sgplot data=sashelp.stocks;
where stock = "IBM";
series x=date y=high;
series x=date y=low;
needle x=date y=volume / y2axis;
y2axis values=(0 to 100000000 by 10000000);
run;
@CathyVI wrote:
I will like to replicate this graph and knowing the types of code to use. Most importantly, I will like to know which sas code will produce the darker line under the mean telomere length.
Using FRINGE statement.
proc sgplot data=sashelp.cars;
loess x=MPG_Highway y=Wheelbase /clm ;
fringe MPG_Highway;
run;
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.