displacing "Lower Confidence Limit of Proportional Reporting Ratio"

This commit is contained in:
frankknoll
2023-11-24 00:12:53 +01:00
parent c834126726
commit fa058a30fd
8 changed files with 18766 additions and 252 deletions

File diff suppressed because one or more lines are too long

View File

@@ -80,7 +80,7 @@ class PrrByKeyTable {
} }
#markRowIfPrrTooHigh({ prr, row }) { #markRowIfPrrTooHigh({ prr, row }) {
if (prr > 1.0) { if (prr >= 2.0) {
$(row).addClass('prrTooHigh'); $(row).addClass('prrTooHigh');
} }
} }

View File

@@ -18,7 +18,7 @@ class PrrBySymptomTableView {
return new PrrByKeyTable({ return new PrrByKeyTable({
tableElement: tableElement, tableElement: tableElement,
keyColumnName: 'Symptom', keyColumnName: 'Symptom',
prrColumnName: 'Proportional Reporting Ratio > 1', prrColumnName: 'Lower Confidence Limit of Proportional Reporting Ratio >= 2',
shallMarkRowIfPrrTooHigh: false shallMarkRowIfPrrTooHigh: false
}); });
} }

View File

@@ -18,7 +18,7 @@ class PrrByVaccineTableView {
return new PrrByKeyTable({ return new PrrByKeyTable({
tableElement: tableElement, tableElement: tableElement,
keyColumnName: 'Vaccine', keyColumnName: 'Vaccine',
prrColumnName: 'Proportional Reporting Ratio', prrColumnName: 'Lower Confidence Limit of Proportional Reporting Ratio',
shallMarkRowIfPrrTooHigh: true shallMarkRowIfPrrTooHigh: true
}); });
} }

View File

@@ -449,13 +449,14 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "eaf8fe21",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"prrByVaccineAndSymptom = pd.read_csv(\n", "prrByVaccineAndSymptom = pd.read_csv(\n",
" 'data/safety-signal-sym.csv',\n", " 'data/tLCI.csv',\n",
" index_col = 'VACCINE')\n", " usecols = lambda x: x != \"Unnamed: 0\",\n",
" index_col = 'VAX_TYPE')\n",
"prrByVaccineAndSymptom.index.name = 'VACCINE'\n",
"prrByVaccineAndSymptom" "prrByVaccineAndSymptom"
] ]
}, },
@@ -499,7 +500,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"prrBySymptomByVaccineWithHighPrrs = PrrSeriesTransformer.filterByHighPrrs(prrBySymptomByVaccine)\n", "prrBySymptomByVaccineWithHighPrrs = PrrSeriesTransformer.filterPrrs(prrBySymptomByVaccine, lambda prr: prr >= 2)\n",
"prrBySymptomByVaccineWithHighPrrs" "prrBySymptomByVaccineWithHighPrrs"
] ]
}, },
@@ -604,7 +605,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"prrBySymptomByLotWithHighPrrs = PrrSeriesTransformer.filterByHighPrrs(prrBySymptomByLot)\n", "prrBySymptomByLotWithHighPrrs = PrrSeriesTransformer.filterPrrs(prrBySymptomByLot, lambda prr: prr > 1)\n",
"prrBySymptomByLotWithHighPrrs" "prrBySymptomByLotWithHighPrrs"
] ]
}, },

View File

@@ -2,17 +2,11 @@ class PrrSeriesTransformer:
@staticmethod @staticmethod
def filterByNonZeroPrrs(prrByVaccineBySymptom): def filterByNonZeroPrrs(prrByVaccineBySymptom):
return PrrSeriesTransformer._filterPrrsBy( return PrrSeriesTransformer.filterPrrs(
prrByVaccineBySymptom, prrByVaccineBySymptom,
lambda prr: prr != 0) lambda prr: prr != 0)
@staticmethod @staticmethod
def filterByHighPrrs(prrBySymptomByVaccine): def filterPrrs(prrByKeyByOtherKey, prrFilter):
return PrrSeriesTransformer._filterPrrsBy(
prrBySymptomByVaccine,
lambda prr: prr > 1)
@staticmethod
def _filterPrrsBy(prrByKeyByOtherKey, prrFilter):
return prrByKeyByOtherKey.map( return prrByKeyByOtherKey.map(
lambda prrByKey: {key: prr for key, prr in prrByKey.items() if prrFilter(prr)}) lambda prrByKey: {key: prr for key, prr in prrByKey.items() if prrFilter(prr)})

View File

@@ -25,22 +25,22 @@ class PrrSeriesTransformerTest(unittest.TestCase):
'17-hydroxyprogesterone': {'6VAX-F': 1.5} '17-hydroxyprogesterone': {'6VAX-F': 1.5}
})) }))
def test_filterByHighPrrs(self): def test_filterPrrs(self):
# Given # Given
prrBySymptomByVaccine = pd.Series( prrBySymptomByVaccine = pd.Series(
{ {
'6VAX-F': {'11-beta-hydroxylase deficiency': 0.6, '17-hydroxyprogesterone': 1.5}, '6VAX-F': {'11-beta-hydroxylase deficiency': 2.6, '17-hydroxyprogesterone': 1.5},
'ADEN': {'11-beta-hydroxylase deficiency': 1.3, '17-hydroxyprogesterone': 0.9} 'ADEN': {'11-beta-hydroxylase deficiency': 1.3, '17-hydroxyprogesterone': 2.9}
}) })
# When # When
prrBySymptomByVaccineWithHighPrrs = PrrSeriesTransformer.filterByHighPrrs(prrBySymptomByVaccine) prrBySymptomByVaccineWithHighPrrs = PrrSeriesTransformer.filterPrrs(prrBySymptomByVaccine, lambda prr: prr >= 2)
# Then # Then
assert_series_equal( assert_series_equal(
prrBySymptomByVaccineWithHighPrrs, prrBySymptomByVaccineWithHighPrrs,
pd.Series( pd.Series(
{ {
'6VAX-F': {'17-hydroxyprogesterone': 1.5}, '6VAX-F': {'11-beta-hydroxylase deficiency': 2.6},
'ADEN': {'11-beta-hydroxylase deficiency': 1.3} 'ADEN': {'17-hydroxyprogesterone': 2.9}
})) }))

File diff suppressed because one or more lines are too long