zepid.base.Specificity¶
-
class
zepid.base.
Specificity
(alpha=0.05)¶ Generates the sensitivity and (1-alpha)% confidence interval, comparing test results to disease status from pandas dataframe
Specificity is calculated from
\[Sp = \frac{FN}{N}\]Wald standard error is
\[SE_{Wald} = (\frac{1}{FN} - \frac{1}{N})^{\frac{1}{2}}\]Note
Disease & Test must be coded as (1: yes, 0:no)
Parameters: alpha (float, optional) – Alpha value to calculate two-sided Wald confidence intervals. Default is 95% confidence interval Examples
Calculate the specificity in a data set >>> from zepid import Specificity, load_sample_data >>> df = load_sample_data(False) >>> spec = Specificity() >>> spec.fit(df, test=’art’, disease=’dead’) # Note this example is not great… ART is a treatment not test >>> spec.summary()
-
__init__
(alpha=0.05)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
([alpha])Initialize self. fit
(df, test, disease)Calculates specificity summary
([decimal])Prints the summary results -