Biology, images, analysis, design...
Use/Abuse Stat.Book Beginners Stats & R
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)



Beginners statistics: proportions

Example, with R,  Definition and Use,  Simple formula,  Tips and Notes,  Test yourself,  References  Download R  R is Free, very powerful, and does the boring calculations & graphs for scientists.

Example, with R

A proportion is simply another name for a mean of a set of zeroes and ones.
The mean of the 5 values, 1   0   0   1   0, is the number of ones divided by 5, or 2/5 or 0.4

Or you could find the proportion of ones with 

Definition and Use

A proportion is the relative frequency of items with a given characteristic in a given set (or p=f/n).
If items with the character are coded 1, and items lacking that character are coded 0, the proportion (p) of items with that character is the sum of their coded values (f) divided by the number of values coded (n).
For example if 5 items are green, and 10 items are not green, then the proportion of green items is 5/(5+10), or 1/3.

A percentage (%) is simply a proportion times 100.

So if the proportion green is 1/3, the percent green is 100/3, or about 33.33%.

Simple formula

Assuming y is a list of n items, coded as either 0 or 1:

the proportion of 1's in y is sum(y)/n

Or, if f of n items are classed as 'A':

the proportion of A's in y is f/n

Tips and Notes

  • If you have n items which are green or not-green, the maximum proportion of green items is 1 (=n/n) the minimum proportion of green items is 0 (=0/n).
  • Also, if you add the proportion of green items, to the proportion of not-green items, the result must be 1 - provided no other classification is possible.
  • If you divide n items into (non-overlapping) classes and calculate the proportion in each class, the sum of those proportions must equal one. This is true no matter how large n may be: even if n is infinite.

Test yourself


Useful references

Wikipedia: Percentage. Full text 
Wikipedia does not have a section on proportion, but a percentage is simply a proportion multiplied by 100..