The right formula for Z score

I have come across the two equation for z score.

  1. Z = (x-u)/ std dev

  2. Z = (x bar - u)/ std error of sample mean, std dev/ root n

what is the difference between this two and when to use? Many thx

Use the former when you’re creating a confidence interval for a single observation.

Use the latter when you’re creating a confidence interval for the mean of a number of observations, or performing an hypothesis test about a mean.

The former one is for one population observation or one sample observation. While the latter one is for many observation ( sampling observation ). Did I get it right?

You did.

Thank you so much, cheers!

The first is descriptive to tell if a certain value is an outlier or suspect outlier and can be used to make intervals that describe where a certain percent of the data values fall. The second is for inferences about the population mean and is usually called a z-statistic.