Questions tagged [sgplot]
49 questions
1
vote
1 answer
SAS SGPLOT VBOX: Display Mean and Median on Boxplot
I am trying to make a boxplot by using the SGPLOT in SAS. I would like to use SGPLOT with VBOX statement to flag out the Mean and Median on the gragh for each box.
Below is the data set I created as an example. Can someone give me a kind help on…

qifengwu
- 129
- 1
- 13
1
vote
1 answer
SAS sgplot step color gradient
I want to generate a "step" plot (CDF) and I'm trying to change the line color using the dattrmap option. But color are not changing. Below is my code:
%MACRO ATRRMAP(fich=,var=);
proc freq data=&fich noprint;
tables &var/nocum nopercent norow…

AppyPoint
- 45
- 6
1
vote
1 answer
SAS: plotting dates excluding weekends using PROC SGPLOT
I'm running SAS 9.3, and I'm trying to create a plot using PROC SGPLOT that (1) shows only dates contained in my dataset as consecutive dates (ie, excluding weekends and holidays), while (2) displaying usable information on the XAXIS (eg, the first…

Eric
- 53
- 1
- 5
1
vote
1 answer
Changing specific observation color (value text) with sgplot - forest plot
I am currently writing an sgplot code for forest plot (SAS University edition). I have managed to get the correct graph as I want, however I can not change the color of a specific observation. This is my code
data my_data;
input study $ year rr…

keripik.singkong
- 13
- 5
1
vote
1 answer
sas sgplot legend & axis labelling
Suppose I have sgplot and my output looks something like
My aim is to adjust the legend and make the bottom section to look something like below. How can I do this?

Lester
- 35
- 7
0
votes
2 answers
Trying to create prevalence chart with error bars and percentages
I am trying to create a bar graph that has error bars showing the upper and lower confidence limits. However all my code will not produce the desired error bars. I would also like to include the prevalence percentages in the graph.
This is the code…

kelsz24
- 23
- 4
0
votes
1 answer
How to adjust the range of the regression line in SAS proc sgplot
The SAS code for the data and plot is below. The regression line will be determined by the 10 data point I have, but I want to control the start and the end of the regression line. For example, I want to keep my current plot, the only change is that…

Mizzle
- 747
- 4
- 14
0
votes
2 answers
Combining 2 PROC SGPANEL Plots into 1 plot
I am using PROC SGPANEL to separate the data for the 2 groups, male and female.
I need to have the scatter plot showing all subjects data points and the average value plot.
I need to combine the graphs together, so the scatter plot and mean line are…
0
votes
1 answer
How to add different color in SGPLOT legend in SAS
Following data has two groups Group 1 and Group 2. Each group has multiple subjects.
data sgplot_CPA;
input trt_group$ time$ subject$ 11. results;
datalines;
Group-1 1 203-070-001 20
Group-1 3 203-070-001 30
Group-1 7 203-070-001…

Uddin
- 754
- 5
- 18
0
votes
3 answers
how to generate unique random vector on each iteration?
I'm new to SAS, I would like to produce plot for each random numerical vector.
therefore I have wrapped my proc iml with a macro, and have tried to invoke it before calling the macro generate_scatter_plot. but I get the same set of points each…

bcg
- 17
- 4
0
votes
1 answer
Sepearte two overlaped line in proc sgplot
I have the following graph showing two variables x and y for each group on y-axix. I'd like to separate blue and red line for each group for a clearer presentation; something like having two very close line (one for x and one for y) for each group…

kiabar
- 63
- 6
0
votes
1 answer
How do I change colours of different bars in SAS?
proc sgplot data=WORK.CUSTOMERDATA;
title height=14pt "Bar Chart of Gender";
vbar Gender / fillattrs= (color=CX024ae6) datalabel;
yaxis grid;
run;
ods graphics / reset;
title;
how do I change the colour of individual bars ? I…

Diamondhands
- 41
- 1
- 6
0
votes
1 answer
Plot Two Regression Lines on Same Scatter Plot By Year: X-Axis Date MM/DD
I have a scatter plot of calls / time. My x variable is the date (Day/Month) and my Y variable is a number of calls on each date. I would like to plot two regression lines using PROC SGPLOT REG, one for 2019 and one for 2020. However, when I try to…

keherder
- 35
- 5
0
votes
2 answers
SAS: How do I rename an axis label name on sgplot scatter plot
I'm an Animal science student from Slovenia and I'm just finishing my master's thesis. For the finishing touches i need to make a bunch of scatter plots of different traits. All my data values (breeding values of different traits) are in code, for…

Urban
- 9
- 1
- 2
0
votes
1 answer
SAS SGPLOT or R ggplot2 - generate separate component for same plot
I would like to generate a plot as attached using SAS or R. Y-axis has a scale of 1 to 100 as a continuous value (with a break of 21 to 49) and X-axis has a categorical scale with two values.
I need to allocate 70% of the plot area to the bottom…

R007
- 101
- 1
- 13