# Z-score calculation for a single variable with readings in multiple units

I ran into little trouble transforming a set of data I need for analysis. I have been trying to analyze results of a lab test as Z-scores. I have an output field with a reading and unit field. Data are shown in the figure below.

The approach I followed was to convert this data to Z-scores by taking every individual subset of data for a unit. So one subset for the unit "IU/L", its SD, mean and subsequently its Z-scores were calculated. The same procedure was repeated for "g/L", "mmol/L", and the like. The calculated Z-scores were then mapped back to the original readings.

Is this approach correct? And are there any work-arounds to reduce the effort this procedure consumes?

• You did not provide the ultimate goal of the analysis nor any motivation for the need for $z$-scores. – Frank Harrell Jan 4 '14 at 13:12
• The intent here is to be able to compare the "Results" data from a bunch of sources. It also gets utilized in PCA and repeat-value detection, amongst a few other preliminary tests. – myriadcolours Jan 4 '14 at 13:46
• I don't see how $z$-scores are relevant for that. If the standard deviations differ you are then comparing different absolute effects, for one thing. – Frank Harrell Jan 5 '14 at 3:34
• @FrankHarrell: The knowledge that Z-scores allow me to bring readings with different units on the same scale, was the motivation. I have also used the values to perform an outlier analysis (as a part of preliminary tests) for which I would need to have all my readings on a common scale. Hence the aforementioned approach. – myriadcolours Jan 5 '14 at 4:40
• By using $z$-scores with different standard deviations in different samples you are actually doing the analysis on different scales. In addition, you are assuming the variables are Gaussian and that "badness" is equidistant from the mean. – Frank Harrell Jan 5 '14 at 14:06