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

Hello,

 

I am using SAS UE and could not manage to change the axes labels in a surface plot (Proc kde). The variable Immo_rev has two stages '1' and '2', with meaning 'immortalized'  and 'not immortalized' but SAS, by default, labels the axis 0.5 / 1.5 / and 2.5.

 

Figure 6 revised, option 2.png

 

I tried using Proc format to give labels for Immo_rev, but these did not appear in the surface plot.

 

Is this an issue of SAS UE or an issue of Proc kde? In other words: what am i doing wrong and how to modify the axes labels in a density plot?

 

Thank you in advance,

 

Bruno

 

 

********** SAS-code:


proc format;
value Immo_rev
1 = ‘Immortalization’
2 = ‘No Immortalization’;
run;

 


ods graphics on;

proc kde data=data;
format Immo_rev Immo_rev.;
bivar distance  Immo_rev / plots = surface ;

* axis1 order=(1 to 2 by 1 value=(height=2) label=(height=2 'Immortalization status'); * one attempt that failed ;
run;

quit;
ods graphics off;

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

PROC KDE assumes that both variables are continuous. If Immo_rev is binary, then it doesn't have a continuous density.  I suggest you plot the univariate density of Distance for both levels of Immo_rev. You can do this by using PROC UNIVARIATE or by using PROC SGPLOT, as follows:

 


proc univariate data=data;
format Immo_rev Immo_rev.;
class Immo_rev;
var distance;
histogram distance / kernel;
run;

proc sgplot data=data;
format Immo_rev Immo_rev.;
density distance / type=kernel group=Immo_rev;
run;

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

PROC KDE assumes that both variables are continuous. If Immo_rev is binary, then it doesn't have a continuous density.  I suggest you plot the univariate density of Distance for both levels of Immo_rev. You can do this by using PROC UNIVARIATE or by using PROC SGPLOT, as follows:

 


proc univariate data=data;
format Immo_rev Immo_rev.;
class Immo_rev;
var distance;
histogram distance / kernel;
run;

proc sgplot data=data;
format Immo_rev Immo_rev.;
density distance / type=kernel group=Immo_rev;
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 652 views
  • 1 like
  • 2 in conversation