Author Topic: Math & Statistics Question  (Read 1298 times)

Offline oneway

  • Silver Member
  • ****
  • Posts: 1385
Math & Statistics Question
« on: April 11, 2011, 06:53:27 PM »
Anybody with a background in stats and number crunching....or anyone for that matter please chime in...

Predicate:

I want to calculate a Kill/Death ratio average across X blocks of data. Each block of data will produce its own unique value for K, and for D

In certain (but infrequent) circumstances, D may equal Zero. K can also equal Zero, but is irrelevant mathematically as well as practically.

Output Desired:

I want to output a true K/D value for use in averaging across X blocks.

Problem:

Division by Zero. If a block in X blocks returns D = 0, K/D will naturally fail.

Typical Solution:

Add 1 to D

Resultant Issue:

Adding 1 to D as a default assumption produces wildly inaccurate K/D ratios when dealing with narrow data sets, and is exacerbated when running further functions such as averaging.
Example: 15 K, 2 D will yield either 7.5 or 5.0; a 50% swing - totally unacceptable rate of return

Question/Proposed Solution:

Is their anything fundamentally wrong with Setting the value of K/D to K when D = 0?, and leaving all other K/D quotients at stock (K/D) ?

 :salute

Oneway


Edit: Whoops, just realized this should have been posted in the General Forum...not this Forum...my apologies (Skuzzy...clean up on Aisle 5)...
« Last Edit: April 11, 2011, 07:10:31 PM by oneway »

Offline Hoff

  • Copper Member
  • **
  • Posts: 124
Re: Math & Statistics Question
« Reply #1 on: April 11, 2011, 07:12:11 PM »
Setting it to K will add 1 to your deaths when there really wasn't a death. I don't know what you're trying to do, but if you're just trying to average kills/death then you just need to take all kills and divide by all deaths. You can't really average an average since they have different scales. You might be 25/1 in one plane and 90/90 in another. If you just went by K/D averages this would come out to be 13, but if you went by total kills/total deaths it would be 1.26.

It would be easier to help you out if I knew exactly what you were trying to do. If, for some reason, you want to average the averages, then you could just use an IF statement for when D = 0 make it D+1 (which can be easily done in excel).
« Last Edit: April 11, 2011, 07:17:34 PM by Hoff »

Offline oneway

  • Silver Member
  • ****
  • Posts: 1385
Re: Math & Statistics Question
« Reply #2 on: April 11, 2011, 07:34:40 PM »
Setting it to K will add 1 to your deaths when there really wasn't a death. I don't know what you're trying to do, but if you're just trying to average kills/death then you just need to take all kills and divide by all deaths. You can't really average an average since they have different scales. You might be 25/1 in one plane and 90/90 in another. If you just went by K/D averages this would come out to be 13, but if you went by total kills/total deaths it would be 1.26.

It would be easier to help you out if I knew exactly what you were trying to do. If, for some reason, you want to average the averages, then you could just use an IF statement for when D = 0 make it D+1 (which can be easily done in excel).

Averaging ratios/quotients, not averages of an average

Potential input include divisors of zero for the initial round of quotient output...before the averaging loop

Read it one more time

If D = 0, then step around K/D and set K/D quotient/output to K

I thinks its pretty clear what the com problem is...I am mixing computer programming language with math...

Would it be correct to step out of the Math flow, and do a direct return assignment?

 :salute

« Last Edit: April 11, 2011, 07:38:56 PM by oneway »

Offline Hoff

  • Copper Member
  • **
  • Posts: 124
Re: Math & Statistics Question
« Reply #3 on: April 11, 2011, 07:39:55 PM »
Averaging ratios/quotients, not averages of an average

Potential input include divisors of zero for the initial round of quotient output...before the averaging loop

Read it one more time

I thinks its pretty clear what the problem is

 :salute




Ratio, quotient, and average can all mean the same thing.

Anyways, like I said, if you really want to do that, just use an IF statement.

Offline Jayhawk

  • Gold Member
  • *****
  • Posts: 3909
Re: Math & Statistics Question
« Reply #4 on: April 11, 2011, 07:42:18 PM »


Okay, so the numbers on the right indicate the problem you're having, being unable to divide by 0.

So total up all Kills, Total up all deaths, and you'll get an accurate number.  That's how I'm understanding the issue, and I believe that was the solution Hoff suggested.  But maybe I still don't quite understand the problem.
LOOK EVERYBODY!  I GOT MY NAME IN LIGHTS!

Folks, play nice.

Offline StokesAk

  • Gold Member
  • *****
  • Posts: 3665
Re: Math & Statistics Question
« Reply #5 on: April 11, 2011, 07:44:17 PM »
Couldn't you just substitute 1 for 0 in your program somehow, it would yield the same K/D as any number divided by 1 is the same?

29 kills
0 deaths

you would get 29/1 which is still a ratio of 29.
Strokes

Offline iaqmya

  • Copper Member
  • **
  • Posts: 163
Re: Math & Statistics Question
« Reply #6 on: April 11, 2011, 07:45:32 PM »
 :noid

This is a game, isn't it?

Offline Hoff

  • Copper Member
  • **
  • Posts: 124
Re: Math & Statistics Question
« Reply #7 on: April 11, 2011, 07:48:11 PM »
Averaging ratios/quotients, not averages of an average

Potential input include divisors of zero for the initial round of quotient output...before the averaging loop

Read it one more time

If D = 0, then step around K/D and set K/D quotient/output to K

I thinks its pretty clear what the com problem is...I am mixing computer programming language with math...

Would it be correct to step out of the Math flow, and do a direct return assignment?

 :salute



(Image removed from quote.)

Okay, so the numbers on the right indicate the problem you're having, being unable to divide by 0.

So total up all Kills, Total up all deaths, and you'll get an accurate number.  That's how I'm understanding the issue, and I believe that was the solution Hoff suggested.  But maybe I still don't quite understand the problem.

Using this excel file as an example. What you want to do, from what I can tell, is to average column C and not get the total average (C10). In that case you need to worry about dividing by zero. To fix this, simply use an IF statement in excel for column B. Any time a 0 is shown in column B, have excel change it to 1. Problem solved.

Offline LLogann

  • Persona Non Grata
  • Platinum Member
  • ******
  • Posts: 4947
      • Candidz.com
Re: Math & Statistics Question
« Reply #8 on: April 11, 2011, 09:43:18 PM »
I'm not so great at math, but I'll say this...

Don't think of it as a Death, think of it as Life..........  A Kill/Life ratio so to speak. 

At the end of the tour if you have no deaths, you have had 1 life. 

If you have died 64 times, you have had 65 lives. 

And thinking about K/D like this may nullify your need to do, what, ever, it may be you're trying to do sir!!!   :salute
See Rule #4
Now I only pay because of my friends.

Offline grizz441

  • Platinum Member
  • ******
  • Posts: 7001
Re: Math & Statistics Question
« Reply #9 on: April 11, 2011, 10:33:50 PM »
I don't see the issue, as individual sortie output shouldn't matter and your K/D is INF if you do not die, however if you want it to be simply the number of kills you recorded, set the C2 cell to IF(B2<1,A2,A2/B2) and drag it down.

Offline Ardy123

  • Gold Member
  • *****
  • Posts: 3417
Re: Math & Statistics Question
« Reply #10 on: April 11, 2011, 10:35:46 PM »
Just change the stat to kills per life...

Then you start off on your first life...

thus...


its k/l and lets say you have 5 kills and one life, then its 5/1 = 5 and your an ace :aok
Yeah, that's right, you just got your rear handed to you by a fuggly puppet!
==Army of Muppets==
(Bunnies)

Offline oneway

  • Silver Member
  • ****
  • Posts: 1385
Re: Math & Statistics Question
« Reply #11 on: April 11, 2011, 10:49:21 PM »
Just change the stat to kills per life...

Then you start off on your first life...

thus...


its k/l and lets say you have 5 kills and one life, then its 5/1 = 5 and your an ace :aok

That is fascinating Ardy

Offline Hoff

  • Copper Member
  • **
  • Posts: 124
Re: Math & Statistics Question
« Reply #12 on: April 11, 2011, 10:52:01 PM »
Just change the stat to kills per life...

Then you start off on your first life...

thus...


its k/l and lets say you have 5 kills and one life, then its 5/1 = 5 and your an ace :aok

Otherwise known as deaths +1....lol

Offline oneway

  • Silver Member
  • ****
  • Posts: 1385
Re: Math & Statistics Question
« Reply #13 on: April 11, 2011, 10:55:52 PM »
Couldn't you just substitute 1 for 0 in your program somehow, it would yield the same K/D as any number divided by 1 is the same?

29 kills
0 deaths

you would get 29/1 which is still a ratio of 29.

Exactly Srokes...your suggestion is exactly how I am leaning on this...I was hoping for input from the stat gurus who make a living crunching ratios......I think your right...I think I am right...I just wish those guys who professionally deal with this sort issue would chime in: IS it ok to replace K/D with K when D is zero?

Their has to be at least one pro stat guy lurking around here who can chime in...what say you ??? How do you handle averages of ratios across data blocks when an element divisor might be ZERO?

The bottom line is if a guy has zero deaths...does it foul or corrupt the data to simply say: When D = 0...then K/D = K
« Last Edit: April 11, 2011, 11:13:32 PM by oneway »

Offline BaldEagl

  • Plutonium Member
  • *******
  • Posts: 10791
Re: Math & Statistics Question
« Reply #14 on: April 11, 2011, 11:12:52 PM »
See my reply in the other forum.
I edit a lot of my posts.  Get used to it.