Running z-tests with R

If you are sure about it or at least have very good reasons to assume that you are right about the population's variance, you should use a z-test. Some would say that you could go strictly to a z-test if you have a big enough sample even if you're estimating your population's variance through sample—which is not assumed by z-tests.

There are mainly two reasons for that. First, as your sample gets bigger—given some conditions such as limited mean—your sample's estimations converge to the true values, and the true parameters; so, with a big enough sample, you have more reasons to believe that you really know the real parameters.

The other reason can be seen in Figure 2.1. With greater samples come greater degrees of freedom ...

Get Hands-On Data Science with R now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.