P-value does not change by transformation/standardization In terms of regression model, I have read a statement that transforming/standardizing variables does not change its p-value as long as we keep the same model.
I recently transformed a variable (took the log and scaled it in R) and when I checked if there was an association between the transformed variable and the other variable by using Wilcoxon test, I found that the p-value remained as same as before I standardized the variable.
Could you please explain about the theory behind this?
Does transforming/standardizing variables always not change its p-value? Or, it only applies with certain condition?
Thank you so much for your time and explanation in advance!
 A: First, let's think about why changing the scale of a variable SHOULDN'T impact the p value.
Let's say I'm analyzing the correlation between age and wages among a sample of workers at a specific company using a simple OLS model (Y=B0+B1*X), where Y is wage and X is age.
I want to know the value of B1 and whether it is significantly different from zero (that's what the p value tells me).
Measuring Y as "dollars per hour"  versus "cents per hour" will change the VALUE of the beta coefficient we get, but it clearly shouldn't (and won't!) change the substantive, magnitudes of relationship between these two variables, or out confidence in the result. If we find that an additional year of age is associated with an additional 0.02 dollars per hour of wage, that is precisely the same thing as finding that an additional year of age is associated with an additional 2 cents of wage. So the beta coefficient will be 0.02 in one model and 2 in the second, but the two values obviously MEAN the same thing. Since they are both describing the exact same relationship and are based on the exact same data, they really should have exactly the same p value.
(You could also think about this in terms of a relationship between anything and temperature: it SHOULDN'T matter whether temperature is measured in Celsius or Fahrenheit)
Now, the mathematical reason that the two coefficients DO, in fact, have the exact same p value is that even though the beta coefficients of the "cents" model is 100 times larger, the standard error of that beta coefficient is ALSO 100 times larger (this, in turn is because the standard deviation of Y is 100 times larger). So when you divide the coefficient by the standard error to get the t value you get the same answer in both models, and because you have the same t value, you have the same p value.
