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.
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;
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;
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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
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.