Hi,
How to plot the graph for only 50 and 75 and rest of the values should not be ploted.And 50 and 75 are different colors.
Please find the attached document for the query and data like
0.249377 | 5.175325 |
0.623441 | 10.3494 |
1.122195 | 15.30481 |
1.745636 | 20.17191 |
2.535328 | 25.06026 |
3.532835 | 30.11836 |
4.655029 | 35.0611 |
5.985037 | 40.02055 |
7.564422 | 45.03658 |
9.476309 | 50.06652 |
11.7207 | 55.02452 |
14.42228 | 60.06016 |
17.58105 | 65.04058 |
21.28013 | 70.03401 |
25.68579 | 75.03019 |
30.96426 | 80.03419 |
37.73899 | 85.0182 |
47.00748 | 90.01258 |
61.01413 | 95.01025 |
100 | 100 |
Thanks and regards
Use either SGPLOT with a WHERE clause and filter it for values 50/75
Your values don't have whole values of 50 or 75 so in the context of Your question it doesn't make sense.
for example i have two variables
1) percentages_agents
2)percentages_premium
i have the values like
0.249377 | 5.175325 |
0.623441 | 10.3494 |
1.122195 | 15.30481 |
1.745636 | 20.17191 |
2.535328 | 25.06026 |
3.532835 | 30.11836 |
4.655029 | 35.0611 |
5.985037 | 40.02055 |
7.564422 | 45.03658 |
9.476309 | 50.06652 |
11.7207 | 55.02452 |
14.42228 | 60.06016 |
17.58105 | 65.04058 |
21.28013 | 70.03401 |
25.68579 | 75.03019 |
30.96426 | 80.03419 |
37.73899 | 85.0182 |
47.00748 | 90.01258 |
61.01413 | 95.01025 |
100 | 100 |
then i have to highlite only 50,75 values of percentages_premium rest of the values should not be plotted.
i have done
symbol value=squarefilled color=vibg cv=vibg interpol=join;
proc gplot data=annexus.annexus_2016a_group_final1_per;
plot cpp*cap/
haxis=0 to 100 by 10
vaxis=0 to 100 by 25
vminor=0
hminor=0
regeqn;
run;
quit;
please replay.
Post test data in the form of a datastep. Don't post attachments like docx/xlsx as these are dangerous and wont be donwloaded. As for your problem,
where int(value) in (50,70);
Can be added to code to have only those values whose whole part is 50 or 70.
hi
As re Reeza suggested I would go for Proc SGPLOT, find below some sample code that can get you started.
data have;
infile cards dlm=",";
input x y;
cards;
0.249377,5.175325
0.623441,10.3494
1.122195,15.30481
1.745636,20.17191
2.535328,25.06026
3.532835,30.11836
4.655029,35.0611
5.985037,40.02055
7.564422,45.03658
9.476309,50.06652
11.7207,55.02452
14.42228,60.06016
17.58105,65.04058
21.28013,70.03401
25.68579,75.03019
30.96426,80.03419
37.73899,85.0182
47.00748,90.01258
61.01413,95.01025
100,100
;
data have2;
set have;
if int(y) = 50 then do;
x2 = x;
y2 = y;
group=1;
end;
if int(y) = 75 then do;
x2 = x;
y2 = y;
group=2;
end;
if 50 <= int(y) <= 75 then do;
x3 = x;
y3 = y;
end;
run;
proc sgplot data=have2 noautolegend;
styleattrs
datasymbols=(DiamondFilled)
datacontrastcolors=(red green)
;
series x=x y=y ;
scatter x=x2 y=y2 / group=group markerattrs=(size=20) ;
run;
proc sgplot data=have2 noautolegend;
series x=x y=y /;
series x=x3 y=y3 / lineattrs=(THICKNESS=5);
refline 50 75;
run;
Bruno
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.