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;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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