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

I want to add an extra tick on X axis to existing values (I don't want to change them). How can I do it, could somebody help me?

There is the code:

 

proc sgplot data=pdf2 noautolegend;
title "Posterior Probability Density - Beta Distribution";
series x=x y=y; /*the curve*/
scatter x=x0 y=pdf0; /*the dot*/
vector x=x0 y=pdf0 /xorigin=x0 yorigin=0 noarrowheads datalabel lineattrs=(color=gray); /*the line below the dot*/
band x=x1 lower=0 upper=y1;
xaxis grid label="x"; 
yaxis grid label="Beta Posterior PDF";
refline 0 / axis=y;
run;

 

shot.PNG

and here should be the value x0 = 0.9 (not hardcoded 0.9, x0 can be changed). I use SAS 9.3, I am hope for your help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

ok. I cant see your data, so if it is not structured exactly like this, then modify yourself, but do something like this

 

data somedata;
	do x = 0 to 1 by 0.01;
		y = x*2;
		x0=0.9;
		output;
	end;
	if _N_=1 then call symputx('x0', x0);
run;

title "Some Plot";
proc sgplot data=somedata;
	series x=x y=y;
	xaxis values=(0 to 1 by 0.2 &x0);
run;

 

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

So you want an extra tick value on the x axis corresponding to the value of x0, but not any other ticks (other than the ones that are already there)?

yermapa
Calcite | Level 5
Exactly 😃 Just this graph with extra 0.9 between 0.8 and 1.0 (x0 has only one value 0.9)
PeterClemmensen
Tourmaline | Level 20

ok. I cant see your data, so if it is not structured exactly like this, then modify yourself, but do something like this

 

data somedata;
	do x = 0 to 1 by 0.01;
		y = x*2;
		x0=0.9;
		output;
	end;
	if _N_=1 then call symputx('x0', x0);
run;

title "Some Plot";
proc sgplot data=somedata;
	series x=x y=y;
	xaxis values=(0 to 1 by 0.2 &x0);
run;

 

yermapa
Calcite | Level 5

I thought about it but hoped that there is more simple solution (like some statement). Thank you for your reply, looks like I have to use this approach.

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!

What is Bayesian Analysis?

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.

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
  • 4 replies
  • 1051 views
  • 1 like
  • 2 in conversation