Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Simple, </p> <ol> <li>multiply each of the 4 values by their weight</li> <li>add the results together</li> <li>divide by the sum of the weights</li> </ol> <h3>Examples</h3> <ul> <li><p>In the example each of the fields can be thought to have an equal weight of 1</p> <pre><code>((0.12 * 1) + (0.67 * 1) + (1.00 * 1) + (0.93 * 1)) / 4 = 0.68 </code></pre></li> <li><p>Now if we want to make field2 worth 2x more than the other fields</p> <pre><code>// Weights are (1 + 2 + 1 + 1) = 5 ((0.12 * 1) + (0.67 * 2) + (1.00 * 1) + (0.93 * 1)) / 5 = 0.678 </code></pre></li> <li><p>If we want field 3 to have 100 times the weight (field 2 is still 2x)</p> <pre><code>// Weights are (1 + 2 + 100 + 1) = 104 ((0.12 * 1) + (0.67 * 2) + (1.00 * 100) + (0.93 * 1)) / 104 = 0.9845192307692308 </code></pre></li> </ul> <h3>Formula</h3> <pre><code>((field1 * field1_weight) + (field2 * field2_weight) + ... + (fieldn * fieldn_weight)) / (field1_weight + field2_weight + ... + fieldn_weight) = weighted_average </code></pre> <h3>Fractional weights</h3> <p>The formula works just the same if you give fractions as weights. For example if you would like the weight of the 4th field to be weighted <code>150%</code> more then the other fields you can assign it weight <code>1.5</code></p> <pre><code>// Weights are (1 + 1 + 1 + 1.5) = 4.5 ((0.12 * 1) + (0.67 * 1) + (1.00 * 1) + (0.93 * 1.5)) / 4.5 = 0.7077777777777778 </code></pre> <h3>Weights are relative</h3> <p>You don't need to start with each of the weights set to 1, you can use 100 or 1000 if you like.</p> <p>For example if the weights for all 4 fields were 100 the final average would be the same if they were all 1.</p> <h3>Further reading</h3> <p><a href="http://en.wikipedia.org/wiki/Weighted_arithmetic_mean" rel="noreferrer">wikipedia: Weighted arithmetic mean</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload