# Multiple measurements within one feature

From US health insurance data, I have 300k prescriptions for an injected biologic from many patients .

For each prescription there's a quantity variable, described by the data vendor as "The number of units dispensed without regard to packaging format".

The packaging of the drug is almost always a box of 4 syringes. A patient can receive multiple boxes.

In practice, the results of this feature is messy for around 10% of the data. Some values are unrealistically high, some too low. See the table below of the top 10 most 'popular' quantity results (left-hand column)

╔══════════╦══════════╦═════════╦══════════╦═════════════╗
║ QUANTITY ║    N     ║ Percent ║  Cum N   ║ Cum Percent ║
╠══════════╬══════════╬═════════╬══════════╬═════════════╣
║        4 ║ 218,408  ║    61   ║ 218,408  ║          61 ║
║        8 ║  56,298  ║    16   ║ 274,706  ║          77 ║
║       12 ║  44,286  ║    12   ║ 318,992  ║          89 ║
║        3 ║  11,204  ║     3   ║ 330,196  ║          92 ║
║       24 ║   9,756  ║     3   ║ 339,952  ║          95 ║
║       39 ║   6,291  ║     2   ║ 346,243  ║          97 ║
║        0 ║   2,515  ║     1   ║ 348,758  ║          98 ║
║        2 ║   1,757  ║     0   ║ 350,515  ║          98 ║
║        7 ║   1,476  ║     0   ║ 351,991  ║          99 ║
║        1 ║   1,202  ║     0   ║ 353,193  ║          99 ║
╚══════════╩══════════╩═════════╩══════════╩═════════════╝


It's likely there's a mixture of measurements:-

• 4,8,12 will likely reflect the number of syringes prescribed
• 1-3 is probably the number of boxes
• 40 is probably 10 boxes of 4 syringes - or is it a typo and should be 4?

And so on. I also expect some results to simply be wrong.

My question is; is there a statistical technique to help tease out the measurement type from this one feature? I have several other features for the prescriptions - cost, supply days, strength of prescription, etc. I also have each patient's prescription history (longitudinal data).

I was considering regression techniques but I suspect that's wrong. I think I need some sort of clustering on the other features to assign probabilities to the quantity result (the probabilities being 'Prob quantity is number of syringes' or 'Prob quantity is number of boxes', etc). I could of course be completely wrong! A hint of where to research would be great.

EDIT:

About 60% of patients purchased 4 items. If that is 4 boxes (e.g., 8 or 16 syringes?) then that is likely more expensive than 4 syringes (e.g., 1 or 2 boxes?). If the true measurement type is "boxes" then the price is likely much higher than if the the true measurement type is "syringes". If you look at those patients with N = 4 and plot a histogram of cost, are there two distinct clusters? Is the distribution multimodal? If so, this would suggest that price is a feature that may be able to cluster that data into groups corresponding to the measurement type. If not, are there other features that may be confounding the relationship (e.g., what if you look at N = 4 and high strength prescriptions?). Create a scatter plot of cost vs price. Does the data appear to cluster? If so, can you infer why the data is clustered in that way? Do other features exhibit similar behavior?

ORIGINAL RESPONSE:

You have "cost" information. This seems like it might be useful to determine whether the measurement type was box or syringe. The "supply days" seems like it would also relate to the measurement type.

I suggest you start with an exploratory analysis. I suggest you create a scatter plot matrix to determine if any of the points appear to cluster with different features.

You don't mention any training data where you have input features with known measurement type labels. Therefore, I think you will need to use unsupervised learning methods such as clustering. I would suggest you start with k-means clustering, unless you are going to incorporate ordinal features.

• I've no training data but I'd be pretty confident that data where quantity = 4,8 or 12 is 'correct'. And I'd expect the pattern of their features to be similar to those when quantity = 1, 2, or 3. But no, I've no official training data. – rambles May 18 '18 at 15:34
• +1 for clustering on features that domain knowledge tells you should be correlated with quantity type. Looking for an alternate source of the average price per box could be helpful (if you don't have an idea already). – timwiz May 18 '18 at 16:16
• I edited my response to explain how your domain knowledge can help you decide if clustering is the right approach – Nat May 18 '18 at 16:24