src.testing.create_rapid_test_statistics
¶
Module Contents¶
Functions¶
|
Calculate the rapid test statistics. |
|
Calculate the rapid test statistics for one channel or overall. |
- create_rapid_test_statistics(demand_by_channel, states, date, params)[source]¶
Calculate the rapid test statistics.
- Parameters
demand_by_channel (pandas.DataFrame) – same index as states. Each column is one channel through which rapid tests can be demanded.
states (pandas.DataFrame) – sid states DataFrame.
date (pandas.Timestamp or str) – date
params (pandas.DataFrame) – parameter DataFrame that contains the sensitivity and specificity of the rapid tests
- Returns
- DataFrame with just one column named 0. The
index contains the date, the number of individuals and for each channel the share of the population that demand a test through this channel, the share of tests in each channel that are demanded by infected individuals.
- Return type
statistics (pandas.DataFrame)
- _calculate_rapid_test_statistics_by_channel(states, rapid_test_results, receives_rapid_test, channel_name)[source]¶
Calculate the rapid test statistics for one channel or overall.
Naming convention for the denominators:
testshare -> n_tests
popshare -> n_people
number -> n_people / POPULATION_GERMANY
- Parameters
states (pandas.DataFrame) – sid states DataFrame.
receives_rapid_test (pandas.Series) – boolean Series with the same index as states. This is the demand Series for one channel or overall.
rapid_test_result (pandas.Series) – boolean Series with the result for each individual. This is False for individuals that were not tested.
channel_name (str) – name of the channel.
- Returns
dict