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 }) {
if (prr > 1.0) {
if (prr >= 2.0) {
$(row).addClass('prrTooHigh');
}
}

View File

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

View File

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

View File

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

View File

@@ -2,17 +2,11 @@ class PrrSeriesTransformer:
@staticmethod
def filterByNonZeroPrrs(prrByVaccineBySymptom):
return PrrSeriesTransformer._filterPrrsBy(
return PrrSeriesTransformer.filterPrrs(
prrByVaccineBySymptom,
lambda prr: prr != 0)
@staticmethod
def filterByHighPrrs(prrBySymptomByVaccine):
return PrrSeriesTransformer._filterPrrsBy(
prrBySymptomByVaccine,
lambda prr: prr > 1)
@staticmethod
def _filterPrrsBy(prrByKeyByOtherKey, prrFilter):
def filterPrrs(prrByKeyByOtherKey, prrFilter):
return prrByKeyByOtherKey.map(
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}
}))
def test_filterByHighPrrs(self):
def test_filterPrrs(self):
# Given
prrBySymptomByVaccine = pd.Series(
{
'6VAX-F': {'11-beta-hydroxylase deficiency': 0.6, '17-hydroxyprogesterone': 1.5},
'ADEN': {'11-beta-hydroxylase deficiency': 1.3, '17-hydroxyprogesterone': 0.9}
'6VAX-F': {'11-beta-hydroxylase deficiency': 2.6, '17-hydroxyprogesterone': 1.5},
'ADEN': {'11-beta-hydroxylase deficiency': 1.3, '17-hydroxyprogesterone': 2.9}
})
# When
prrBySymptomByVaccineWithHighPrrs = PrrSeriesTransformer.filterByHighPrrs(prrBySymptomByVaccine)
prrBySymptomByVaccineWithHighPrrs = PrrSeriesTransformer.filterPrrs(prrBySymptomByVaccine, lambda prr: prr >= 2)
# Then
assert_series_equal(
prrBySymptomByVaccineWithHighPrrs,
pd.Series(
{
'6VAX-F': {'17-hydroxyprogesterone': 1.5},
'ADEN': {'11-beta-hydroxylase deficiency': 1.3}
'6VAX-F': {'11-beta-hydroxylase deficiency': 2.6},
'ADEN': {'17-hydroxyprogesterone': 2.9}
}))

File diff suppressed because one or more lines are too long