**Degrees of Freedom: 1-Sample t test**

You have a data set with 10 values. If you’re not estimating anything, each value can take on any number, right? Each value is completely free to vary.

But suppose you want to test the population mean with a sample of 10 values, using a 1-sample t test. You now have a constraint—the estimation of the mean.

This explanation would make more sense to me if they said that the constraint arises from using a sample variance to estimate a population variance. That would explain why you use d.f. on one-sample t but not one-sample z.

But, given that they say the constraint arises from using the sample mean to estimate the pop mean, I can't understand the discrepancy between z test and t-test. Both z-statistic and t-statistic use a sample mean to estimate a population mean.