// Election-eve U.S. regular gasoline: nominal, in Sept-2026 dollars (CPI-U NSA), and minutes of work per gallon (AHETPI) const CPI_REF = 336.940; // CPIAUCNS Sept 2026, latest published const rows = [ // year, election date, price date, price, source, cpi, cpiBasis, wage [1976,'1976-11-02','1976 Q4 avg',0.628,'BLS',58.033,'Q4 avg',null], [1978,'1978-11-07','1978 Q4 avg',0.697,'BLS',67.400,'Q4 avg',null], [1980,'1980-11-04','1980 Q4 avg',1.253,'BLS',85.533,'Q4 avg',null], [1982,'1982-11-02','1982 Q4 avg',1.279,'BLS',97.933,'Q4 avg',null], [1984,'1984-11-06','1984 Q4 avg',1.203,'BLS',105.300,'Q4 avg',null], [1986,'1986-11-04','1986 Q4 avg',0.825,'BLS',110.400,'Q4 avg',null], [1988,'1988-11-08','1988 Q4 avg',0.945,'BLS',120.333,'Q4 avg',null], [1990,'1990-11-06','1990-11-05',1.334,'EIA',132.7,'Sep',10.27], [1992,'1992-11-03','1992-11-02',1.120,'EIA',141.3,'Sep',10.83], [1994,'1994-11-08','1994-11-07',1.123,'EIA',149.4,'Sep',11.39], [1996,'1996-11-05','1996-11-04',1.223,'EIA',157.8,'Sep',12.13], [1998,'1998-11-03','1998-11-02',1.010,'EIA',163.6,'Sep',13.11], [2000,'2000-11-07','2000-11-06',1.526,'EIA',173.7,'Sep',14.13], [2002,'2002-11-05','2002-11-04',1.448,'EIA',181.0,'Sep',15.05], [2004,'2004-11-02','2004-11-01',2.034,'EIA',189.9,'Sep',15.78], [2006,'2006-11-07','2006-11-06',2.200,'EIA',202.9,'Sep',16.87], [2008,'2008-11-04','2008-11-03',2.400,'EIA',218.783,'Sep',18.20], [2010,'2010-11-02','2010-11-01',2.806,'EIA',218.439,'Sep',19.11], [2012,'2012-11-06','2012-11-05',3.492,'EIA',231.407,'Sep',19.79], [2014,'2014-11-04','2014-11-03',2.993,'EIA',238.031,'Sep',20.66], [2016,'2016-11-08','2016-11-07',2.233,'EIA',241.428,'Sep',21.62], [2018,'2018-11-06','2018-11-05',2.753,'EIA',252.439,'Sep',22.86], [2020,'2020-11-03','2020-11-02',2.112,'EIA',260.280,'Sep',24.82], [2022,'2022-11-08','2022-11-07',3.796,'EIA',296.808,'Sep',27.87], [2024,'2024-11-05','2024-11-04',3.069,'EIA',315.301,'Sep',30.39], [2026,'2026-11-03','2026-10-26',4.269,'EIA',336.940,'Sep',32.60], ]; const out = rows.map(([y,ed,pd,p,src,cpi,cb,w])=>({year:y,electionDate:ed,priceDate:pd,source:src,nominal:p,cpi,cpiBasis:cb, real2026:+(p*CPI_REF/cpi).toFixed(2), wage:w, minutesPerGallon: w? +(p/w*60).toFixed(1):null})); const csv = ['year,election_date,price_date,price_source,nominal_usd_per_gal,cpi_u_nsa,cpi_basis,real_sep2026_usd_per_gal,avg_hourly_earnings_prod_nonsup,minutes_of_work_per_gallon', ...out.map(r=>[r.year,r.electionDate,r.priceDate,r.source,r.nominal.toFixed(3),r.cpi,r.cpiBasis,r.real2026.toFixed(2),r.wage??'',r.minutesPerGallon??''].join(','))].join('\n'); require('fs').writeFileSync('election-eve-gas.csv',csv+'\n'); console.log(csv); const byReal=[...out].sort((a,b)=>b.real2026-a.real2026).map(r=>r.year+':'+r.real2026).join(' '); const byMin=[...out].filter(r=>r.minutesPerGallon).sort((a,b)=>b.minutesPerGallon-a.minutesPerGallon).map(r=>r.year+':'+r.minutesPerGallon).join(' '); console.log('REAL rank',byReal);console.log('MIN rank',byMin);