Skip to content

Commit 454dd48

Browse files
committed
README tweaks
1 parent 437f579 commit 454dd48

1 file changed

Lines changed: 53 additions & 31 deletions

File tree

README.rst

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ Features
88
^^^^^^^^
99

1010
* Approximating sums
11-
* Approximating proportions
1211
* Approximating medians
13-
* Approximating ratios
12+
* Approximating percent change
1413
* Approximating products
14+
* Approximating proportions
15+
* Approximating ratios
1516

1617

1718
Installation
@@ -50,24 +51,6 @@ Accepts an open-ended set of paired lists, each expected to provide an estimate
5051
19866960, 5437.757350231803
5152
5253
53-
Approximating proportions
54-
~~~~~~~~~~~~~~~~~~~~~~~~~
55-
56-
Calculate an estimate's proportion of another estimate and approximate the margin of error. Follows the bureau's `ACS handbook <https://www.documentcloud.org/documents/6177941-Acs-General-Handbook-2018-ch08.html>`_. Simply multiply the result by 100 for a percentage. Recommended when the first value is smaller than the second.
57-
58-
Accepts two paired lists, each expected to provide an estimate followed by its margin of error. The numerator goes in first. The denominator goes in second. In cases where the numerator is not a subset of the denominator, the bureau recommends using the approximate_ratio method instead.
59-
60-
.. code-block:: python
61-
62-
>>> single_women_in_virginia = 203119, 5070
63-
>>> total_women_in_virginia = 690746, 831
64-
>>> census_data_aggregator.approximate_proportion(
65-
single_women_in_virginia,
66-
total_women_in_virginia
67-
)
68-
0.322, 0.008
69-
70-
7154
Approximating medians
7255
~~~~~~~~~~~~~~~~~~~~~
7356

@@ -125,22 +108,25 @@ If a design factor is not provided, no margin of error will be returned.
125108
>>> census_data_aggregator.approximate_median(income)
126109
42211.096153846156, None
127110
128-
Approximating ratios
129-
~~~~~~~~~~~~~~~~~~~~
130111
131-
Calculate the ratio between two estimates and approximate its margin of error. Follows the bureau's `ACS handbook <https://www.documentcloud.org/documents/6177941-Acs-General-Handbook-2018-ch08.html>`_.
112+
Approximating percent change
113+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132114

133-
Accepts two paired lists, each expected to provide an estimate followed by its margin of error. The numerator goes in first. The denominator goes in second. In cases where the numerator is a subset of the denominator, the bureau recommends uses the approximate_proportion method.
115+
Calculates the percent change between two estimates and approximates its margin of error. Follows the bureau's `ACS handbook <https://www.documentcloud.org/documents/6177941-Acs-General-Handbook-2018-ch08.html>`_.
116+
117+
Accepts two paired lists, each expected to provide an estimate followed by its margin of error. The first input should be the earlier estimate in the comparison. The second input should be the later estimate.
118+
119+
Returns both values as percentages multiplied by 100.
134120

135121
.. code-block:: python
136122
137-
>>> single_men_in_virginia = 226840, 5556
138-
>>> single_women_in_virginia = 203119, 5070
139-
>>> census_data_aggregator.approximate_ratio(
140-
single_men_in_virginia,
141-
single_women_in_virginia
142-
)
143-
1.117, 0.039
123+
>>> single_women_in_fairfax_before = 135173, 3860
124+
>>> single_women_in_fairfax_after = 139301, 4047
125+
>>> census_data_aggregator.approximate_percentchange(
126+
single_women_in_fairfax_before,
127+
single_women_in_fairfax_after
128+
)
129+
3.0538643072211165, 4.198069852261231
144130
145131
146132
Approximating products
@@ -161,6 +147,42 @@ Accepts two paired lists, each expected to provide an estimate followed by its m
161147
61393366, 202289
162148
163149
150+
Approximating proportions
151+
~~~~~~~~~~~~~~~~~~~~~~~~~
152+
153+
Calculate an estimate's proportion of another estimate and approximate the margin of error. Follows the bureau's `ACS handbook <https://www.documentcloud.org/documents/6177941-Acs-General-Handbook-2018-ch08.html>`_. Simply multiply the result by 100 for a percentage. Recommended when the first value is smaller than the second.
154+
155+
Accepts two paired lists, each expected to provide an estimate followed by its margin of error. The numerator goes in first. The denominator goes in second. In cases where the numerator is not a subset of the denominator, the bureau recommends using the approximate_ratio method instead.
156+
157+
.. code-block:: python
158+
159+
>>> single_women_in_virginia = 203119, 5070
160+
>>> total_women_in_virginia = 690746, 831
161+
>>> census_data_aggregator.approximate_proportion(
162+
single_women_in_virginia,
163+
total_women_in_virginia
164+
)
165+
0.322, 0.008
166+
167+
168+
Approximating ratios
169+
~~~~~~~~~~~~~~~~~~~~
170+
171+
Calculate the ratio between two estimates and approximate its margin of error. Follows the bureau's `ACS handbook <https://www.documentcloud.org/documents/6177941-Acs-General-Handbook-2018-ch08.html>`_.
172+
173+
Accepts two paired lists, each expected to provide an estimate followed by its margin of error. The numerator goes in first. The denominator goes in second. In cases where the numerator is a subset of the denominator, the bureau recommends uses the approximate_proportion method.
174+
175+
.. code-block:: python
176+
177+
>>> single_men_in_virginia = 226840, 5556
178+
>>> single_women_in_virginia = 203119, 5070
179+
>>> census_data_aggregator.approximate_ratio(
180+
single_men_in_virginia,
181+
single_women_in_virginia
182+
)
183+
1.117, 0.039
184+
185+
164186
A note from the experts
165187
^^^^^^^^^^^^^^^^^^^^^^^
166188

0 commit comments

Comments
 (0)