Hi Guys,
This histogram is not going my way. I'd like to achieve:
- present the all rows taller so Y-axis would show 0 through 100 by increasing the vertical dimension of the whole plot.
- customize and label GROUPS so it will appear as "benign" instead group=6 and "malignant" instead group=5 so forth so on for all groups.
You help will be greatly appreciated.
Thanks in advance.
proc univariate data=HAVE noprint;
class GROUP;
histogram VALUES/ nrows = 6
vaxis = 0 to 100 by 1;
inset median mean std / pos = ne format = 6.3;
run;
data Have;
do GROUP = 1 to 6;
do j = 1 to 50;
VALUES = rand("Normal", Group);
output;
end;
end;
run;
Use the ODS GRAPHICS statement to set the vertical size of the plot.
Use PROC FORMAT to define the categories that you want to use for the GROUP=1 to 6 values:
data Have;
do GROUP = 1 to 6;
do j = 1 to 50;
VALUES = rand("Normal", Group);
output;
end;
end;
run;
proc format;
value TumorFmt
1 = "Benign"
2 = "Cat 2"
3 = "Next Value"
4 = "Another"
5 = "Almost There"
6 = "Malignant";
run;
ods graphics / height=1000px width=400px;
proc univariate data=HAVE noprint;
format GROUP TumorFmt.;
class GROUP;
histogram VALUES/ nrows = 6
vaxis = 0 to 100 by 10;
inset median mean std / pos = ne format = 6.3;
run;
Use the ODS GRAPHICS statement to set the vertical size of the plot.
Use PROC FORMAT to define the categories that you want to use for the GROUP=1 to 6 values:
data Have;
do GROUP = 1 to 6;
do j = 1 to 50;
VALUES = rand("Normal", Group);
output;
end;
end;
run;
proc format;
value TumorFmt
1 = "Benign"
2 = "Cat 2"
3 = "Next Value"
4 = "Another"
5 = "Almost There"
6 = "Malignant";
run;
ods graphics / height=1000px width=400px;
proc univariate data=HAVE noprint;
format GROUP TumorFmt.;
class GROUP;
histogram VALUES/ nrows = 6
vaxis = 0 to 100 by 10;
inset median mean std / pos = ne format = 6.3;
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.