BookmarkSubscribeRSS Feed
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10

NflStartingQbVintages.png

 

Another NFL Sunday, another NFL chart, this time a SAS ODS Graphics Dot Plot using data from Wikipedia's List of starting quarterbacks in the National Football League. QB's are presented in draft year order with their draft year marked with a football icon, next to which their draft pick number is displayed. Have a great weekend, all!

(Note: Updated 9/24)

 

* Fun With SAS ODS Graphics: NFL Starting Quarterback Vintages
  Data as of 9/23/2023 from wikipedia.org/wiki/List_of_starting_quarterbacks_in_the_National_Football_League;
                                                  * Import Wikipedia data that was copy-and-pasted into Excel;
proc import datafile='/home/ted.conway/NFLstartingQBsWikipedia.xlsx' dbms=xlsx out=QB replace;

data QB2;                                         * Prep the data up for charting;
length drafted 3.;                                * Year QB was drafted;
set qb(where=(team^=""));                         * Skip blank Excel rows;
team=scan(team,1,"(");                            * Clean up team name;
team=substr(team,1,length(team)-2);
QB=trim(quarterback)||' ('||trim(team)||')';      * Concatenate QB and team name; 
Drafted=substr("Year drafted (pick)"n,1,4);       * Grab year of draft;
xPickLabel=drafted+.3;                            * Used to plot bar chart with draft pick # label;                
xLastYear=2023.5;                                 * Used to draw horizontal QB reference bar;  
pick=scan("Year drafted (pick)"n,2,"()");         * Extract pick #;
 
proc sort data=qb2; by Drafted descending pick;   * Sort QBs in draft year order;

%SGANNO;      * Anotate chart with NFL.com photo of Mahomes using SAS-provided macros;         
data wine;    * Mahomes 2017 vintage 'wine bottle created with stoneycreekwinepress.com/labelmaker-pro;
%SGIMAGE (image="/home/ted.conway/Mahomes2017Wine.png",drawspace="DATAVALUE",yc1="C. J. Stroud (Houston Texans)",x1=2010.5,height=97,heightunit="PERCENT",anchor="BOTTOM");

ods graphics / antialias height=8.5in width=11in; * Set image size;
proc sgplot data=qb2 noborder noautolegend sganno=wine; * Plot QB's (Dot + Bar Charts);
symbolimage name=football image="/home/ted.conway/MicrosoftFootballIcon.png"; * Custom marker - football icon from PowerPoint;
inset "NFL Starting QB Vintages" "Year Drafted & Pick" / textattrs=(size=20pt) position=topright valuealign=right; * Use inset for title;
hbar QB / barwidth=.1 fillattrs=(color=cxf5f5f5) nooutline response=xLastYear; * Use bar chart to create horizontal reference lines;
hbar QB / datalabel=pick barwidth=.1 fillattrs=(color=cxf5f5f5) nooutline response=xPickLabel; * Use bar chart to plot draft pick # to right of football;
dot QB / markerattrs=(symbol=football size=16pt) response=Drafted categoryorder=respasc; * Plot QBs' draft years using football icon markers;
xaxis display=(nolabel) values=(2009 to 2023 by 1) grid; * QBs were drafted between 2009 and 2023;
yaxis display=(nolabel);                          * Suppress y-axis label;
run;

    

Football Icon Used for Markers (Courtesy of Microsoft PowerPoint!)

MicrosoftFootballIcon.png

 

Screenshot of Wikipedia Data (Copied-And-Pasted Into Excel)

 

QuarterbackWikipediaData.jpg

1 REPLY 1
Kurt_Bremser
Super User

One thing that would really be interesting (at least for me 🙂 😞 Superbowl winning QB's by draft round.

Addendum: or those which are voted best on their position for a year, grouped by draft round.

 

Both would illuminate the relative value of draft position vs. the later success in the league.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 732 views
  • 3 likes
  • 2 in conversation