Solved – No Difference for t-test with Standardized Values

data transformationhypothesis testingspssstandardizationt-test

I have a dataset where I am looking at two different flowers with different heights. I have standardized the height and are doing a t-test to see if there is a difference in means for the two flowers in terms of heights.

When I do the t-test for the standardized heights (as opposed to the original height in the data) I still get the same t-statistic and p-value. I'm pretty sure this is what should be happening but would like an explanation as to why this occurs.

Best Answer

This is what should be happening. When you standardize (z-score) the flower heights, you are just doing a linear transformation of the data.

Imagine I had Group 1 with scores 8, 10, and 12 and Group 2 with scores 4, 6, and 8. The means for Group 1 and Group 2 are 10 and 6, respectively. So the mean difference you would be testing with a t-test is 4 (i.e., 10 - 6).

But what would happen if you subtracted 4 from every score? Group 1 and Group 2 means are now 6 and 2, respectively, but the mean difference you would be testing is the same: 4. So the t-test would show the exact same result.

Now, when you z-score (standardize) a variable, all you are doing is taking the raw score, subtracting the mean of the raw scores from it, and then dividing by the standard deviation of the raw scores. Just like above, the mean difference is preserved. You know you are doing a linear transformation because the correlation between raw and standardized scores is 1. Here's some R code showing that:

set.seed(1838) # Setting seed for replicability
raw <- rnorm(100,mean=10,sd=4) # Creating raw scores
z <- scale(raw) # Standardizing scores
cor(raw,z) # Looking at correlation between the two
plot(raw,z) # Plotting values

The correlation is 1, and the plot looks like this:

enter image description here