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

2025_NFL_DRAFT_PICKS.png

 

Using 2025 NFL Draft data, here's a SAS ODS Graphics scatter + box plot of all 257 draft picks by position. A version with interactive tool tips containing some info on all draftees can be found on GitHub Pages. Go [your team here]!

 

* Fun With SAS ODS Graphics: 2025 NFL Draft Picks At-A-Glance
  Data from sportingnews.com/us/nfl/news/nfl-draft-picks-2025-live-results/1df59786e708218d8793ee67,
            espn.com/nfl/draft/rounds, nfl.com/draft/tracker/picks/1/1/2025;
            
proc import datafile='/home/ted.conway/NFL_DRAFT_PICKS_2025.xlsx' out=nflpicks dbms=xlsx replace; * Get data (was copied/pasted/tweaked in Excel);

proc sql;                                             * Split up composite field into individual fields;                                                    
create table nflpicks2a as
select round as Round, roundpick as RoundPick, overallpick as OverallPick, team as Team, scan(playerpositionschool,1,',') as Player, 
scan(playerpositionschool,2,',') as Position, scan(playerpositionschool,3,',') as School
from nflpicks p;
                                                      * Calc total # players at each position;
create table nflpicks2b as
select p.*, tot.players 
from nflpicks2a p
left join (select position, count(*) as players from nflpicks2a group by 1) tot on p.position=tot.position;
                                                      * Highlight top picks for each position (and one unexpectedly late pick!);
create table nflpicks2 as 
select n.*, case when toppick is not null or player='Shedeur Sanders' then trim(player)||' '||cats('(',school,')') end as topplayer
from nflpicks2b n 
left join (select position, min(overallpick) as toppick from nflpicks2b group by 1) p on n.overallpick=toppick
order by players desc;
                                                      * Calc xaxis points for reference lines for beginning of each round; 
select overallpick into :reflines separated by ' ' from nflpicks2 where roundpick=1 and overallpick>1 order by 1;  

proc sort data=nflpicks2 out=nflpicks3; 
by overallpick;
                                                      * Calc positions for Round 1 ... Round 7 headers at top of chart (x2axis);
data rounds(keep=round overallpick);                  * Figure out overall draft # for first pick in each round;
set nflpicks3 end=eof;
n=_n_;
if roundpick=1 or eof;                                * Also keep overall draft # of last pick;

data midpoints(keep=midpoint);                        * Calc midpoints of round picks for "ROUND N" x2axis headings;
set rounds end=eof;
lagr=lag(round);
lagp=lag(overallpick);
if lagr=. then midpoint=0;                            * First point on x2axis;                
else midpoint=lagp+(overallpick-lagp)/2;              * Points for "ROUND N" headings (N=1-7);
output;
if eof; midpoint=overallpick; output;                 * Last point on x2axis (last draft pick #);

proc sql;                                             * Save x2axis values for proc sgplot;
select distinct midpoint into :midpoints  separated by ' ' from midpoints order by 1;

ods html5 path='/home/ted.conway/nfldraft2025' body='nfldraft2025.html' options(bitmap_mode="inline");
ods graphics / reset imagemap=on height=9in width=16in imagefmt=png noborder imagename='NFLDRAFT2025'; 

proc sgplot data=nflpicks2 noautolegend;
title height=14pt bold '2025 NFL DRAFT PICKS';
hbox overallpick / group=position fillattrs=(transparency=.6) category=position Fill noOutliers nomean lineattrs=(thickness=0); * Box plot to show distributions/quartiles;
scatter x=overallpick y=position / x2axis markerattrs=(symbol=circle size=7pt) tip=(overallpick round RoundPick player position school team);  * Scatter plot of individual picks with tooltips;
scatter x=overallpick y=position / markerattrs=(symbol=circle size=0pt) datalabel=topplayer datalabelattrs=(size=9pt); * Scatter plot to display names of top picks;
yaxis discreteorder=data display=none;                 * y-axis is player positions;
yaxistable position / position=left label="POS" labelattrs=(size=9pt) valueattrs=(size=9pt) labeljustify=left;
yaxistable players / position=left stat=MEAN label='#' labelattrs=(size=9pt) valueattrs=(size=9pt);
xaxis label='OVERALL DRAFT PICK';                      * x-axis is overall draft pick numbers;
x2axis display=(noline noticks nolabel) valueattrs=(size=9pt) values=(&midpoints) valuesdisplay=('' 'ROUND 1' 'ROUND 2' 'ROUND 3' 'ROUND 4' 'ROUND 5' 'ROUND 6' 'ROUND 7' ''); * Show Round headings at top on x2axis;
refline &reflines / axis=x;                            * Show reference lines at beginning of each round;
run;
ods html5 close;

  

SAMPLE DATA

2025_NFL_DRAFT_PICKS_DATA.png

  

HTML5 Version With Tooltips

2025_NFL_DRAFT_PICKS_TOOL_TIPS.png

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 578 views
  • 0 likes
  • 1 in conversation