In Excel you can do the calculation of the standard deviation in two different ways in order to perform a Z-Transformation. Once as a formula for sample data and once as a formula for population data. The difference is divided by N or divided by N-1. So this brings minimally different results of the standard deviation and with this the Z-Scores afterwards.


In Stata, the default formula within egen newvar=std (oldvar) is set to a treatment as sample data. I learned this by comparing both Excel versions to the Stata version. The Stata Z transformation matches the Excel Z transformation for sample data. But I can’t find a way to change this within the egen command options. For my purposes, I need the Z-transformation for population data. A workaround would be to just import the calculated Excel values into stata or live with minimal differences, but both are not the perfect solution.

Maybe someone knows a solution for my problem. I would appreciate the help.

Best, Stephan