BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
valli
Calcite | Level 5

Hi 

 

Below sample data 

visit     dosem   avalue

1          50         8.66

 2         50         6.33

1          100        6.88

2           100        8.33

1           200       76.22

2           200        65.22

1           400       55.88

2           400       88.77

1           50      77.22

2           50      54.3

3            50       54

4             50      45

5             50     0.003

6             50     .001

I am trying to generate a plot whi ch will have all avalues as scatter points by each visitn

like dose*avalue=visit

i want to represent median line in the plot

also i want a regression ln(dose) = ln(avalue)

                             then (intercept*x**slope) is equation

 

VISIT variable decode

I calculated median and regression estimates values kept in one dataset

1-single dose scatter plot

2-multiple dose scatter plot

3.median of single dose

4.median of multiple dose

5.regression value of single dose

6.multiple dose regrssion value

 

then I used below procedure

 

symbol1 color=black value=circle height=1.5 mode=include INTERPOL=none;
symbol2 color=grey value=trianglefilled height=1.5 mode=include INTERPOL=none;
symbol3 color=blue w = 3 height=2 mode=include INTERPOL=hiloct;
symbol4 color=green w = 3 height=2 mode=include INTERPOL=hiloct ;

/* Define the symbol characteristics for the regression line */
symbol5 interpol=rl value=none color=black;
*symbol5 interpol=join value=dot color=black l=1;
*symbol6 interpol=join value=circle color=black l=2;
symbol6 interpol=rl value=none color=grey l=2;

proc sort data = x1;
by avisitn dose ;
run;


proc gplot data = x1;
plot avalue * dose = avisitn/ vaxis=axis1 haxis=axis2 noframe nolegend;
run;
quit;

 

My question my regression line not coming staright and also

I want both x,y scales in log base and custom tick marks

 

The data i gave example so values may not look correct

appreciate help

 

thank u

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MINX
Obsidian | Level 7

Hi @valli

 

If you want to overlay scatter, median line and regression line on one plot. There are two options:

1. PROC GPLOT, use PLOT, PLOT2 statements and ANNOTATION for three tasks. ex. you can use ANNOTATION for scatter, PLOT for median line and PLOT2 for regression line with SYMBOL statement to define INTERPOL=R<type><0><CLM | CLI<50...99>>. (http://www.okstate.edu/sas/v8/sashtml/gref/zbolchap.htm)

2. SGPLOT or SGSCATTER depend on the output you want to display.

 

Hope it will help.

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Please submit usable data:

Your variable names are inconsistent, axis1 and axis2 statements are not provided.

 

Regarding the regression, did you see this message that your code generates? :

WARNING: Fewer than three node values for at least one observation in HILOC interpolation. Mean value used for tick placement.

 

 

MINX
Obsidian | Level 7

Hi @valli

 

If you want to overlay scatter, median line and regression line on one plot. There are two options:

1. PROC GPLOT, use PLOT, PLOT2 statements and ANNOTATION for three tasks. ex. you can use ANNOTATION for scatter, PLOT for median line and PLOT2 for regression line with SYMBOL statement to define INTERPOL=R<type><0><CLM | CLI<50...99>>. (http://www.okstate.edu/sas/v8/sashtml/gref/zbolchap.htm)

2. SGPLOT or SGSCATTER depend on the output you want to display.

 

Hope it will help.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 2 replies
  • 1416 views
  • 0 likes
  • 3 in conversation