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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: