Need some help with javascript

Talk about and discuss various advancements and achievents in the arts and sciences of invention and modification; computers, sciences, mathematics, and technology for all.

0
No votes
 
Total votes: 0

User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#11

Post by raum »

apparently, the passing rate is calculated differently in different league, and this formula didn't quite do it right. it would better to make all the calculations far more visible, and I will work on that later today.

The NFL's system uses four metrics: completion percentage, yards per attempt, percentage of touchdowns thrown per attempt, and percentage of interceptions per attempt. The four factors are weighted equally.

A score between 0 and 2.375 is calculated for each metric. A score of 1.0 is supposed to be average. A completely average quarterback would complete 50 percent of his passes, average 7 yards per attempt, throw 5 percent of his passes for touchdowns, and throw an interception 5.5 percent of the time.

Here's how each metric is calculated (remember that no score can be lower than zero or higher than 2.375, no matter how well or how poorly the QB throws):

1. Completion percentage: Subtract 30 from the percentage of passes that are thrown for completions, then multiply by .05.

2. Yards per attempt: Subtract yards per passing attempt by three, then multiply by .25.

3. Touchdown percentage: Multiply the percentage of touchdown passes per passing attempt by .2.

4. Interception percentage: Multiply the percentage of interceptions per passing attempt by .25, then subtract that number from 2.375.

The scores for each category are added together. That sum is divided by six and multiplied by 100, which converts it into a rating on a scale from zero to 158.3. A putatively average QB would receive a rating of 66.7 (1 + 1 + 1 + 1 = 4, and 4/6 * 100 = 66.7).

If you don't have the patience for the math, you can enter the numbers into this ratings calculator.

No matter how well a QB plays, his score can never exceed 158.3, even if every pass is a 99-yard touchdown strike. By the same token, a QB's rating can never drop below zero, even if every pass he throws gets picked off.

The NFL emphasizes that its ratings system assesses how well a quarterback passes, not how well a quarterback plays. It doesn't account for rushing yardage or rushing touchdowns, nor does it account for variables such as leadership, play calling, or how good the team's wide receivers or offensive linemen are. But as this article points out, the NFL's ratings system is also limited in how well it measures passing. The system doesn't value third-down conversions, avoidance of sacks, or late-game heroics. (It actually penalizes a quarterback who throws an incompletion to avoid a sack.) John Elway's career passer rating is 79.9, good for 33rd overall, below lesser contemporary QBs such as Neil Lomax and Danny White.

One other problem with the NFL's system: In the modern NFL, the average rating is higher than 66.7. That's because the scores are calculated based on what the NFL thought would be average statistics for a quarterback in 1973, when the system was introduced. But in 1978, the NFL changed its rules to open up the passing game, by prohibiting defenders from bumping receivers downfield and by allowing offensive linemen to extend their arms to pass-block. As a result, modern-day QBs dominate the list of all-time passers. (Though old Cleveland Browns great Otto Graham still ranks third. Click here to view the list kept by the Pro Football Hall of Fame. You'll need Adobe Acrobat to view it.) Last year's average passer rating was 78.1, roughly equivalent to the career rating for Johnny Unitas.


-----

as for Ty,.. um i have four variables, and you gave me eight stats. give me four values, and preferably like so

C=completions = ##
A=attempts = ##
Y=yards =##
T=Touchdowns = ##
I=interceptions = ##

BBcode:
Hide post links
Show post links
User avatar
AYHJA
392
Posts: 37990
Joined: Fri Sep 17, 2004 2:25 pm
Location: Washington, D.C.
Contact:

#12

Post by AYHJA »

QUOTE(AYHJA)Here are the stats of great USC Trojan QB Matt Leinhart... /:D" style="vertical-align:middle" emoid=":D" border="0" alt=":D" />  

Completions - Attempts - Yards - Comp. % - YPA - Long - Touchdowns - Interceptions

283  431  3815  65.7  8.85  67  28  8

And next years Heisman Trophy Winner, Brady Quinn

292  450  3919  64.9  8.71  80  32  7  

Now...Lets see if your new toy can calculate the correct ratings raumie...

Matt

C=completions = 283
A=attempts = 431
Y=yards =3815
T=Touchdowns = 28
I=interceptions = 8

Brady

C=completions = 292
A=attempts = 450
Y=yards =3919
T=Touchdowns = 32
I=interceptions = 7

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#13

Post by raum »

can one of you find me some REAL stats to do some control testing. that one website and me differed a good deal. but i have reason to think they have it right.

give me NFL stats:

C
A
Y
T
I

and I have those other calculations for
Completion %
Y.P.A.
TD %
Int %
and of course:
Passing Rate.

i need to control test though, and build the integrity differently.

and the formulas you started with were not complete... and neither are the ones on these other sites.

BBcode:
Hide post links
Show post links
User avatar
AYHJA
392
Posts: 37990
Joined: Fri Sep 17, 2004 2:25 pm
Location: Washington, D.C.
Contact:

#14

Post by AYHJA »

I forgot that they do PR different in college than they do in the pros...Lets try this...

Ben Roth:

C - 168
A - 268
Y - 2385
T - 17
I - 9

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#15

Post by raum »

98.5541... for Mr. Ben Roth. not sure how it gets rounded, or to what place.

my numbers are accurate, according to that other calculator. i forgot to put in the ceiling and the floor on the numbers. Ben

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#16

Post by raum »

crap,.. this is taking too long. for some reason certain control tests wqork, and others, like this one fail. ARGH.

i gotta work. for real.

but i will look at this later.

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#17

Post by raum »

ok, this is aggravating... this dude who made this other site has his formulas up, and his sums are equal to mine,.. but his calc has them all wrong... sometimes. ARGH.

ok, someone give a break down, of CAYTI, and the breakdown stats (Comp%, YPA, TD%, Int%) which factor the QB rating.

I have it, and it looks right, but control testing is a bitch with that conditional value validated by nested IF statements.

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#18

Post by raum »

my findings are conclusive... on the NFL setting for his calculator, he has a discrepancy in his completion percentage formula, in the actual calculator.

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#19

Post by raum »

gt got back to me, and said it tests out with stats he already knows to be true.

assume it works,.. get back to me if you notice it doesn't.

that being said, i could make this the beginning of something larger, if you people have direction.

(as time allows)

Ch

BBcode:
Hide post links
Show post links
gtsch
Posts: 17
Joined: Tue Jan 10, 2006 10:18 pm

#20

Post by gtsch »

A couple of other guys from my forum on the site are going to try it out, I'll let you know about their thoughts when they get back to me.

BBcode:
Hide post links
Show post links
Post Reply