A Statistical Battle — z-Test vs. t-Test
Every person, every day, is faced with decisions that involve numbers. Most of these decisions are based on statistical analysis.
When faced with statistical analysis, we need tests to test for statistical significance. These tests tell us whether the numbers we have represent some actual underlying population parameters or are just random fluctuations in our sample data. The data collected through experiments are precisely that — data points.
Two well-known statistical tests for data are the z-test and the t-test.
This article will compare two statistical hypothesis testing methods.
What is a z-test?
The?z-test is a statistical hypothesis test that compares an experimental set of data with a ‘normal distribution’ or Gaussian.
?The z-test statistic is used to check that your data is normally distributed before looking for outliers.
?Outliers can completely skew your test results if they are given too much weight.
σ = Sample Standard Deviation n = Sample size
What is a t-test?
The t-test is a statistical method used to determine if observed data is significantly different from the expected (theoretical) data.
? It is used to identify differences between two means, which are used in testing hypotheses and assumptions of null hypothesis statistical significance testing.
? Clinical trials can help calculate sample size requirements by estimating a treatment’s effect size and the standard deviation of an outcome variable.
T-test Assumptions
When should you use each one?
“Statistics is as much about deciding what to do as doing it” (D. S. Sivia, 2008).
The level of significance is above which we can reject the null hypothesis.
The hypothesis testing is the same in both cases (z-test vs. t-test). It’s merely how we test our hypothesis that changes.
领英推荐
If you follow the steps of hypothesis testing, then you’ll find that the last step of hypothesis testing is to compare your test statistic with a table of rejection region boundaries.
If your hypothesis test is for the mean, then you’re going to use a z-test. The steps of hypothesis testing can be found here.
1. State your null hypothesis and alternative hypothesis.
2. Select your significance level and all needed info from sample z test data.
3. Collect data from a random sample(s).
4. Compute what’s called “critical z-score.”
5. Compare critical z-score with your test statistic.
6. If the test statistic is greater than the critical z-score, hence rejecting the null hypothesis and concluding that you have enough evidence to support the alternative hypothesis or else the null hypothesis is not rejected.
If your hypothesis test is for proportions, then you’re going to use a t-test. We compute what’s called a “critical t-value” by dividing our chosen alpha level into our degrees of freedom.
This test has five steps:
1. State your null hypothesis and alternative hypothesis
2. Select your significance level and all needed info for sample t-test data.
3. Collect data from a random sample(s)
4. Compute the test statistic
5. Compare critical t-value.
However, one should weigh the advantages and drawbacks of each test before deciding.
Advantages of z-test:
But there are disadvantages to using the z-test:
Advantages of t-test:
Disadvantages of t-test:
Key Takeaway
Figuring out which z-test or t-test is suitable for your data analysis problem can be confusing. On top of choosing the correct statistical test, you must think about sample size, alpha, and data distribution.
It’s no surprise that people take a long time to decide about which test to use when.
Excelsior Data Science programs ?will teach you to avoid common mistakes and make repeatable, accurate results. Follow our step-by-step guide; you’ll learn how to run a t-test or z-test on your data, what hypothesis tests are and how they work, when you should use which one, and a lot more.
So, when someone asks you which test to perform, you can confidently tell them that z-tests are more appropriate for use when trying to measure the effect of one or more independent variables on a single dependent variable. On the other hand, t-tests would be better suited to cases where you need to compare two (or more) dependent