BookmarkSubscribeRSS Feed
CathyVI
Pyrite | Level 9

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. 

 

Adewumi_0-1621360761840.png

 

5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

What does the graph represent?

CathyVI
Pyrite | Level 9
The graph represent a two-piecewise linear regression model. This is the link to the article
https://pubmed.ncbi.nlm.nih.gov/32411758/
ballardw
Super User

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.

 

Reeza
Super User

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. 

 

Adewumi_0-1621360761840.png

 


 

Ksharp
Super User

Using FRINGE statement.

 

proc sgplot data=sashelp.cars;
loess x=MPG_Highway y=Wheelbase /clm ;
fringe MPG_Highway;
run;

sas-innovate-white.png

Our biggest data and AI event of the year.

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.

 

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1094 views
  • 5 likes
  • 5 in conversation