0

I am trying to create four data frames from an existing data frame. There are six variables in the existing dataframe, those variables are "est"(which contains the mean for 64 objects), "lower"(which is the lower confidence level for the mean), "upper"(upper confidence interval), "test"(tests from epiR package which include specificity, sensitivity, positive predictive value, negative predictive value), "type" (which has two values, quantified and detected) and "lead" (which is lead time in days). so the new dataframe would only include the specificity values for lead days 0-7

I want the new dataframes to include the previous variables, but I want each one to only include one kind of test so one dataframe would only have the positive predictive value, another would only have sensitivity, etc. here is a sample of the data from df `allfigs'

          est     lower     upper                      test    type   lead
1  0.9523810 0.7618401 0.9987951               Sensitivity   Detected    0
2  0.5958549 0.5229983 0.6657197               Specificity   Detected    0
3  0.2040816 0.1293422 0.2974379 Positive Predictive Value   Detected    0
4  0.9913793 0.9529045 0.9997818 Negative Predictive Value   Detected    0
5  0.7619048 0.5283402 0.9178241               Sensitivity Quantified    0
6  0.8031088 0.7399185 0.8567400               Specificity Quantified    0
7  0.2962963 0.1797804 0.4360907 Positive Predictive Value Quantified    0
8  0.9687500 0.9285823 0.9897769 Negative Predictive Value Quantified    0
9  0.8666667 0.6927816 0.9624465               Sensitivity   Detected    1
10 0.6086957 0.5341719 0.6796574               Specificity   Detected    1
11 0.2653061 0.1811906 0.3640956 Positive Predictive Value   Detected    1
12 0.9655172 0.9140617 0.9905261 Negative Predictive Value   Detected    1
13 0.6000000 0.4060349 0.7734424               Sensitivity Quantified    1
14 0.8043478 0.7395721 0.8590451               Specificity Quantified    1
15 0.3333333 0.2109199 0.4747450 Positive Predictive Value Quantified    1
16 0.9250000 0.8726553 0.9606473 Negative Predictive Value Quantified    1`

0 Answers0