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 R
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.
In principle, 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%.
The crucial difference between a percentage an a proportion is you cannot have a proportion greater than one (1), but you can have a percentage greater than 100%. Proportions can only have values from zero to one. Percentages cannot be less than zero.
- For example, if the price of onions doubled (say from 1 dollar, to 2 dollars) their price has increased by 200% (2/1*100) compared to the original price. In other words "proportionally" the onions are twice as expensive.
Note: Percentages calculated from a proportion (the ratio of two frequencies) have quite different properties from those calculated from the ratio of, for example, two prices.
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.
- Wikipedia: Percentage.
- Wikipedia does not have a section on proportion, but a percentage is simply a proportion multiplied by 100..