Hi.
I am trying to just do a singular box plot for the data below - the box plot shows in the default colours but i want to change the blue of the box plot to pink, also i have seen elsewhere people have put a table inside the graph stating the quarters and the medium, how do i do that as well?
here is my code:
PROC IMPORT DATAFILE = '/home/imdb-videogames.csv' OUT = Videogame_data DBMS = CSV REPLACE; RUN; DATA Videogame_data; SET Videogame_data; IF NOT MISSING(rating) AND NOT MISSING(votes) AND NOT MISSING(certificate); RUN; PROC SORT DATA=Videogame_data OUT=clean_videogamedata NODUPKEY; BY name; RUN; DATA Videogame_data; SET clean_videogamedata; RUN; DATA TITLES; SET clean_videogamedata; words = COUNTW(name,' '); RUN; PROC PRINT DATA=TITLES; VAR name words; TITLE 'Number of Words in each Video Game Title'; RUN; PROC MEANS DATA=TITLES NWAY NOPRINT; VAR WORDS; OUTPUT OUT = MEANS (DROP = _TYPE_ _FREQ_) N = NUMBER_OF_OBSERVATIONS MEAN = AVERAGE ; RUN; PROC PRINT DATA=MEANS NOOBS; TITLE 'Average Number of Words Per Video Game Title'; RUN; PROC sgplot DATA=TITLES; vbox words; styleattrs datacolors=(pink) datacontrastcolors=(black); run;
here is my outcome (statistically is fine - visually is not how i want it).
Thank you in advance for any help here 🙂
See here :
SAS ODS Graphics: Procedures Guide
SGPLOT Procedure
https://go.documentation.sas.com/doc/en/pgmsascdc/v_031/grstatproc/n1waawwbez01ppn15dn9ehmxzihf.htm
PROC sgplot DATA=sashelp.heart;
vbox Cholesterol / DATASKIN=GLOSS
fillattrs=(color=lightgreen transparency=.2)
lineattrs=(pattern=dashdashdot color=pink thickness=4)
WHISKERATTRS=(pattern=solid color=pink thickness=7)
DISPLAYSTATS=(Q1 MEDIAN Q3);
*styleattrs datacolors=(pink) datacontrastcolors=(black);
run;
Koen
See here :
SAS ODS Graphics: Procedures Guide
SGPLOT Procedure
https://go.documentation.sas.com/doc/en/pgmsascdc/v_031/grstatproc/n1waawwbez01ppn15dn9ehmxzihf.htm
PROC sgplot DATA=sashelp.heart;
vbox Cholesterol / DATASKIN=GLOSS
fillattrs=(color=lightgreen transparency=.2)
lineattrs=(pattern=dashdashdot color=pink thickness=4)
WHISKERATTRS=(pattern=solid color=pink thickness=7)
DISPLAYSTATS=(Q1 MEDIAN Q3);
*styleattrs datacolors=(pink) datacontrastcolors=(black);
run;
Koen
Start with Maxim1 and do:
PROC sgplot DATA=sashelp.cars;
vbox invoice /
FILLATTRS=(color=pink)
LINEATTRS=(color=black thickness=2)
MEANATTRS=(color=black )
MEDIANATTRS=(color=black)
WHISKERATTRS=(color=black thickness=2)
;
run;
Bart
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.
Find more tutorials on the SAS Users YouTube channel.