Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS...

21
Z Test & T Z Test & T Test Test PRESENTED BY : GROUP 1 PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMAN MD SHAHIDUR RAHMAN ROLL# 003 ROLL# 003 MD AMINUL ISLAM MD AMINUL ISLAM ROLL# 007 ROLL# 007 MRS ROZINA KHANAM MRS ROZINA KHANAM ROLL# 038 ROLL# 038

Transcript of Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS...

Page 1: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Z Test & T TestZ Test & T Test

PRESENTED BY : GROUP 1PRESENTED BY : GROUP 1MD SHAHIDUR RAHMANMD SHAHIDUR RAHMAN ROLL# 003ROLL# 003

MD AMINUL ISLAMMD AMINUL ISLAM ROLL# 007ROLL# 007

MRS ROZINA KHANAMMRS ROZINA KHANAM ROLL# 038ROLL# 038

Page 2: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Sometimes measuring every single piece of Sometimes measuring every single piece of item is just not practicalitem is just not practical

Statistical methods have been developed to Statistical methods have been developed to solve these problemssolve these problems

Most practical way is to measure a sample of Most practical way is to measure a sample of the populationthe population

Some methods test hypotheses by comparisonSome methods test hypotheses by comparison Two most familiar statistical hypothesis tests Two most familiar statistical hypothesis tests

are :are : T-test T-test Z-testZ-test Cont’dCont’d

Page 3: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Z-test and T-test are basically the sameZ-test and T-test are basically the same They compare between two means to They compare between two means to

suggest whether both samples come from suggest whether both samples come from the same populationthe same population

There are variations on the theme for the T-There are variations on the theme for the T-testtest

Having a sample and wish to compare it with Having a sample and wish to compare it with a known mean, single sample T-test is a known mean, single sample T-test is appliedapplied

Cont’dCont’d

Page 4: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Both samples not independent and have Both samples not independent and have some common factor (geo location, before - some common factor (geo location, before - after), the paired sample T-test is appliedafter), the paired sample T-test is applied

Two variations on the two sample T-test:Two variations on the two sample T-test:

The first uses samples with unequal The first uses samples with unequal variancesvariances

The second uses samples with equal The second uses samples with equal variancesvariances

Page 5: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Use a Z-Test when you know the mean (µ) of Use a Z-Test when you know the mean (µ) of the population we are comparing our sample the population we are comparing our sample to and the standard deviation (to and the standard deviation () of the ) of the population we are comparing our sample to.population we are comparing our sample to.

Use T-test for dependant samples when Use T-test for dependant samples when subjects tested are matched in some way or subjects tested are matched in some way or use T-test for independent samples when use T-test for independent samples when subjects are not matched. subjects are not matched.

Page 6: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

The The Z-test compares the mean from a researchZ-test compares the mean from a researchsample to the mean of a population. Detailssample to the mean of a population. Details

( , ) of the population must be known.μ σ( , ) of the population must be known.μ σ

The The t-test compares the means from twot-test compares the means from tworesearch samples. Used when the populationresearch samples. Used when the population

details ( , ) are unknown.μ σdetails ( , ) are unknown.μ σ

Page 7: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

A T-test is a statistical hypothesis testA T-test is a statistical hypothesis test The test statistic follows a Student’s T-The test statistic follows a Student’s T-

distribution if the null hypothesis is truedistribution if the null hypothesis is true The T-statistic was introduced by W.S. The T-statistic was introduced by W.S.

Gossett under the pen name “Student”Gossett under the pen name “Student” T-test also referred to as the “Student T-test”T-test also referred to as the “Student T-test” T-test is most commonly used Statistical Data T-test is most commonly used Statistical Data

Analysis procedure for hypothesis testingAnalysis procedure for hypothesis testing It is straightforward and easy to useIt is straightforward and easy to use It is flexible and adaptable to a broad range of It is flexible and adaptable to a broad range of

circumstancescircumstances Cont’dCont’d

Page 8: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

T-test is best applied when:T-test is best applied when: Limited sample size (n < 30)Limited sample size (n < 30) Variables are approximately normally Variables are approximately normally

distributeddistributed Variation of scores in the two groups is not Variation of scores in the two groups is not

reliably differentreliably different If the populations’ standard deviation is If the populations’ standard deviation is

unknownunknown If the standard deviation is known, best to If the standard deviation is known, best to

use Z-test use Z-test Cont’dCont’d

Page 9: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Various T-tests and two most commonly applied Various T-tests and two most commonly applied tests are :tests are :

One-sample T-testOne-sample T-test : Used to compare a sample : Used to compare a sample mean with the known population mean.mean with the known population mean.

Paired-sample T-tests Paired-sample T-tests : Used to compare two : Used to compare two population means in the case of two samples population means in the case of two samples that are correlated. Paired sample t-test is that are correlated. Paired sample t-test is used in ‘before after’ studies, or when the used in ‘before after’ studies, or when the samples are the matched pairs, or the case is a samples are the matched pairs, or the case is a control study. control study.

Page 10: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Data sets should be independent from each Data sets should be independent from each other except in the case of the paired-sample t-other except in the case of the paired-sample t-testtest

Where Where nn<30 the t-tests should be used<30 the t-tests should be used The distributions should be normal for the The distributions should be normal for the

equal and unequal variance t-testequal and unequal variance t-test The variances of the samples should be the The variances of the samples should be the

same for the equal variance t-testsame for the equal variance t-test Cont’dCont’d

Page 11: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

All individuals must be selected at random All individuals must be selected at random from the populationfrom the population

All individuals must have equal chance of All individuals must have equal chance of

being selectedbeing selected Sample sizes should be as equal as possible Sample sizes should be as equal as possible

but some differences are allowedbut some differences are allowed

Page 12: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

AssumptionsAssumptions: Matched pair, normal distributions, same : Matched pair, normal distributions, same variance and observations must be independent of each variance and observations must be independent of each other.other.

Steps in the calculationSteps in the calculation::1. 1. Set up hypothesisSet up hypothesis: Two hypotheses: Two hypotheses

HH00=Assumes that mean of two paired samples ==Assumes that mean of two paired samples =

HH11=Assumes that means of two paired samples =Assumes that means of two paired samples 2. 2. Select the level of significanceSelect the level of significance: Normally 5%: Normally 5%3. 3. Calculate the parameterCalculate the parameter: t = d / : t = d / s s2 2 / n , n-1 is df/ n , n-1 is df4. 4. Decision makingDecision making: Compare calculated value (cv) with : Compare calculated value (cv) with table value (tv). If cv table value (tv). If cv tv, reject tv, reject HH00 , , If cv If cv tv, accept tv, accept HH00

and say that there is no significant mean difference and say that there is no significant mean difference between the two paired samples in the paired sample t-test.between the two paired samples in the paired sample t-test.

Page 13: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

The Z-test is also applied to compare sample The Z-test is also applied to compare sample and population means to know if there’s a and population means to know if there’s a significant difference between them.significant difference between them.

Z-tests always use:Z-tests always use:

Normal distributionNormal distribution

Ideally applied if the standard deviation is Ideally applied if the standard deviation is knownknown

Cont’dCont’d

Page 14: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Z-tests are often applied if :Z-tests are often applied if :

Other statistical tests like t-tests are applied in Other statistical tests like t-tests are applied in substitutesubstitute

Incase of large samples (n > 30)Incase of large samples (n > 30)

When t-test is used in large samples, the t-test When t-test is used in large samples, the t-test becomes very similar to the Z-testbecomes very similar to the Z-test

Fluctuations that may occur in t-tests sample Fluctuations that may occur in t-tests sample variances, do not exist in Z-testsvariances, do not exist in Z-tests

Page 15: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Data points should be independent from each Data points should be independent from each otherother

Z-test is preferable when Z-test is preferable when nn is greater than 30 is greater than 30 The distributions should be normal if The distributions should be normal if nn is low, is low,

if if nn>30 the distribution of the data does not >30 the distribution of the data does not have to be normalhave to be normal

The variances of the samples should be the The variances of the samples should be the

samesame Cont’dCont’d

Page 16: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

All individuals must be selected at random All individuals must be selected at random from the populationfrom the population

All individuals must have equal chance of All individuals must have equal chance of

being selectedbeing selected Sample sizes should be as equal as possible Sample sizes should be as equal as possible

but some differences are allowedbut some differences are allowed

Page 17: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Question #1: Does the research sample come from Question #1: Does the research sample come from a population with a known mean?a population with a known mean?

Example: Does prenatal exposure to drugs affect Example: Does prenatal exposure to drugs affect the birth weight of infants?the birth weight of infants?

Question #2: Is the population mean really what it Question #2: Is the population mean really what it is claimed to be?is claimed to be?

Examples: Does this type of car really run 12 kpl?Examples: Does this type of car really run 12 kpl?Does this diet pill really let people lose an average Does this diet pill really let people lose an average of 25 pounds in 6 weeks?of 25 pounds in 6 weeks?

Page 18: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Research question: Do Dhaka College students differ in Research question: Do Dhaka College students differ in IQ scores from the average college student of BD?IQ scores from the average college student of BD?

Data : National average, Data : National average, = 114, = 114, = 15, N=150, X = 117 = 15, N=150, X = 117 Steps in Calculation:Steps in Calculation:1.   Set null and alternative hypothesis:(From data)1.   Set null and alternative hypothesis:(From data) HH00: : = 114 ,  mean of the population from which we = 114 ,  mean of the population from which we

got our sample is equal to 114.got our sample is equal to 114. HH11: : 114 , mean of the population from which we 114 , mean of the population from which we

got our sample is got our sample is not equal to 114.not equal to 114.2. Select level of significance, generally 5%2. Select level of significance, generally 5%3.   State decision rules :  If z3.   State decision rules :  If zobsobs < +1.96 or z < +1.96 or zobsobs > -1.96, > -1.96,

reject Hreject H00

4.   Compute standard error of mean: 4.   Compute standard error of mean: xx = = //N = 1.225N = 1.225

5.   Calculate z-value: z = X - µ / 5.   Calculate z-value: z = X - µ / xx = + 2.45 Cont’d = + 2.45 Cont’d

Page 19: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

6.   Compare observed z to decision rules, and make 6.   Compare observed z to decision rules, and make decision to reject or not reject null.decision to reject or not reject null. 2.45 > 1.96, so reject H2.45 > 1.96, so reject H0. 0.  so, more likely that the  so, more likely that the

sample mean is from some other population.sample mean is from some other population. Statistically significant difference between Statistically significant difference between sample mean and the population mean.sample mean and the population mean.7.   If H7.   If H00 rejected, compare sample mean, and make a rejected, compare sample mean, and make a

conclusion about the research question:conclusion about the research question: Observed mean was statistically significantly Observed mean was statistically significantly greater than the population mean we compared it greater than the population mean we compared it to 117 to 117 > 114.> 114. So, it can be concluded that Dhaka College So, it can be concluded that Dhaka College students have higher IQ test scores than the students have higher IQ test scores than the average college students of BD.average college students of BD.

Page 20: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Z-test is a statistical hypothesis test that follows a Z-test is a statistical hypothesis test that follows a normal distribution while T-test follows a Student’s T-normal distribution while T-test follows a Student’s T-distribution.distribution.

A T-test is appropriate when handling small samples A T-test is appropriate when handling small samples (n<30) while a Z-test is appropriate when handling (n<30) while a Z-test is appropriate when handling moderate to large samples (n > 30).moderate to large samples (n > 30).

T-test is more adaptable than Z-test since Z-test will T-test is more adaptable than Z-test since Z-test will often require certain conditions to be reliable. often require certain conditions to be reliable. Additionally, T-test has many methods that will suit any Additionally, T-test has many methods that will suit any need.need.

T-tests are more commonly used than Z-tests.T-tests are more commonly used than Z-tests. Z-tests are preferred than T-tests when standard Z-tests are preferred than T-tests when standard

deviations are known.deviations are known.

Page 21: Z Test & T Test PRESENTED BY : GROUP 1 MD SHAHIDUR RAHMANROLL# 003 MD AMINUL ISLAMROLL# 007 MRS ROZINA KHANAMROLL# 038.

Q & AQ & A