Skip to content

Commit

Permalink
strand: test for univ mr with hs
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoarbitrio committed Jun 19, 2020
1 parent c23bfca commit 20fff5c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/integration/test_cubepart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,38 @@ def it_provides_values_for_cat_with_means_and_insertions(self):
)
assert strand.title == "Untitled"

def it_provides_std_dev_err_univ_mr_with_hs(self):
strand = Cube(CR.UNIV_MR_WITH_HS["slides"][0]["cube"]).partitions[0]

np.testing.assert_almost_equal(
strand.standard_deviation,
[
0.46426724,
0.3584419,
0.2351762,
0.32431855,
0.2891897,
0.24800318,
0.15104855,
0.49700725,
0.14466968,
],
)
np.testing.assert_almost_equal(
strand.standard_error,
[
0.00453318,
0.00504326,
0.00531142,
0.00513733,
0.00521646,
0.0052914,
0.00541038,
0.00407718,
0.00541584,
],
)

def it_places_insertions_on_a_reordered_dimension_in_the_right_position(self):
"""Subtotal anchors follow re-ordered rows.
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/test_multiple_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ def test_proportions_simple_mr():
np.testing.assert_almost_equal(table_proportions, (0.6, 0.6666667, 0.0))


def test_std_dev_err_simple_mr():
strand = Cube(CR.SIMPLE_MR).partitions[0]

np.testing.assert_almost_equal(
strand.standard_deviation, [0.4898979, 0.4714045, 0.0]
)
np.testing.assert_almost_equal(
strand.standard_error, [0.2828427, 0.2357023, np.nan]
)


def test_1D_mr_with_means():
strand = Cube(CR.MR_MEAN_FILT_WGTD).partitions[0]
np.testing.assert_almost_equal(
Expand Down

0 comments on commit 20fff5c

Please sign in to comment.