Z test
DR JATIN CHHAYA
       ASSISTANT PROFESSOR
DEPARTMENT OF COMMUNITY MEDICINE,
 GMERS MEDICAL COLLEGE, JUNAGADH
                Learning Objectives
⚫ Understand Hypothesis
⚫ Level of Significance
⚫ Standard Error
⚫ Significance Level with Normal Distribution Curve
⚫ Process of Hypothesis Testing, Z test and
  Interpretation of Results
⚫ Calculation- Difference between Two Mean or Two
  Proportion
          What we Going to Understand..
1.   In a Study on Growth of Children, One group of 100
     Children had a mean Height of 60 cm and SD of 2.5 cm
     while another group of 150 children had a mean height of
     62 cm and SD of 3 cm. Is the Difference between the two
     group statistically Significant?
2.   In a nutritional study, 100 children were given usual diet
     and 100 were given vitamin A and D tablets. After 6
     months, average weight of group A was 29kg with SD of
     1.8kg and average weight of group B was 30kg with SD of
     2kg. Is the difference is significant?
           Introduction - Hypothesis
⚫ Hypothesis is a predictive statement, capable of
  being tested by scientific methods, that relates an
  independent variables to some dependent variable.
e.g.
⚫ Students who receive counseling will show a greater
  increase in creativity than students not receiving
  counseling
                Characteristics of Hypothesis
⚫ Clear and precise.
⚫ Capable of being tested.
⚫ Stated relationship between variables.
⚫ Must be specific.
⚫ Stated as far as possible in most simple terms so that the same is easily
   understand by all concerned.
⚫ Consistent with most known facts.
⚫ Responsive to testing with in a reasonable time. One can’t spend a life time
   collecting data to test it.
⚫ Explain what it claims to explain; it should have empirical reference
                          Null Hypothesis
⚫ It is a Hypothesisi of No Difference (Nullifies the claim that Experimental
   results is different from observed one) and we hold as true unless we have
   sufficient statistical evidence to conclude otherwise.
⚫ Null Hypothesis is denoted by 𝐻0
⚫ If a population mean is equal to hypothesized mean then Null Hypothesis
   can be written as
                                    𝐻0:𝜇=𝜇0
Eg:
⚫ ‘there is no difference in the location of superstores and small grocers
  shops’
⚫ ‘there is no connection between the size of farm and the type of farm’
               Alternative hypothesis
⚫ The Alternative hypothesis is reversal of null hypothesis
  and is denoted by 𝐻𝑎
⚫ If Null is given as - 𝐻0:𝜇=𝜇0
⚫ Then alternative Hypothesis can be written as
                          𝐻𝑎:𝜇≠𝜇0
                          𝐻𝑎:𝜇>𝜇0
                          𝐻𝑎:𝜇<𝜇0
                 Level of significance
⚫ Significance means the percentage risk to reject a
  null hypothesis when it is true and it is denoted by 𝛼.
  Generally taken as 1%, 5%, 10%
⚫ It   simply     means         probability     of      committing
  acceptable Type 1 error in statistical Test
        Level Of Significance      Z test Table Value
                  0.01                        2.58
                  0.05                        1.96
                           SE
⚫ Individual Variation: How Spread Out a data Set is
  measured by SD
⚫ Group variation: How Spread Out a Data Set Measured
  By SE
Eg: When we withdrawn a different samples from a Large
  Population; obviously it have different sample means for
  respective samples and Like SD; SE measures how this
  means “Spread Out” around actual population mean.
                            SE
⚫ Like SD; SE also Follows the Normal Distribution
     Curve, it means
1.    Mean ± 1 SE limits include 68% of Sample Values
2.    Mean ± 2 SE limits include 95% of Sample Values
3.    Mean ± 3 SE limits include 99% of Sample Values
⚫     SE Does not means you made a mistake, its just a
      Chance variation at Given Level of Significance
    Significance level (Two Tailed Test)
A Sample Distribution Showing Rejection of H0 at LOS 5% and
                         Power 95%
Procedure for Hypothesis Testing
 State the null (Ho)and alternate (Ha) Hypothesis
        State a significance level; 1%, 5%, 10% etc.
     Decide a test statistics; z-test, t-test, F-test.
             Compute or Calculate Z value
 If Calculate Z Value is greater than the Table Z value at Given
       Level of Significance, that means it Reject the Null
             Hypothesis (Difference is Significant)
 And If Calculate Z Value is Smaller than the Table Z value at
    Given Level of Significance, that means it Accept the Null
            Hypothesis (Difference is Insignificant)
                Calculation
            DETERMINE APPROPRIATE TEST
                Z TEST FOR THE MEAN
  (STANDARD ERROR OF DIFFERENCE BETWEEN TWO MEANS)
               Z TEST FOR THE PROPORTION
(STANDARD ERROR OF DIFFERENCE BETWEEN TWO PROPORTIONS)
TEST FOR SINGLE MEAN
               Test for Single Mean
⚫ Suppose Government has Received a Complaint
  Against municipal schools that boy of them were
  underfed…
⚫ (In universe – from literature) Average weight of
  Boys of age 10, is 32 Kgs with S.D= 9 Kgs
⚫ A sample of 100 boys were selected from municipal
  school of same age and average weight found to be
  29.5 kg
               Test for Single Mean
⚫ At α =0.05, we need to check whether the complaint
  is true or not (we check the average weight is
  closure to mean of population or far away
  from population)
⚫ H0 : 𝜇 = 32, no significant difference between two
  students
⚫ H1 : 𝜇 < 32, there is significant difference between
  students and complaint is true
⚫ If we accept H1; than what it mean Complain is true
                     Test for Single Mean
⚫ Z = X1 - 𝜇                             As obtained value of z (-2.77) is
    SE of Mean                           higher than critical value (Z
⚫ Z = X1 - 𝜇                             Table value at LOS 5% is 1.96),
        σ/ √n
  X1 = Sample mean                       The   observed      difference     is
  𝜇 = Population Mean
  σ = Standard Deviation of Population   significant, we Reject the Null
  N = number of Sample                   Hypothesis    and     accept      the
                                         alternate     hypothesis         and
  Z = 29.5 – 32
                                         conclude     that   students       of
        9/ √100
                                         Municipal school were underfed
  Z = - 2.77
                                         and underweight.
 Calculation: Standard Error of Difference B/w Two Means of
                        Large Sample
⚫ Null Hypothesis Explain That if Samples are drawn
  Randomly and Sufficient in Large Size, their mean should
  not differ from Population Mean.
⚫ Non-Zero Value of Difference between Two Means is only
  acceptable when
      “Calculated Z value” is smaller than “table Z value” (means lesser than 1.96
      times of SE at LOS 5%) and we accept the Null Hypothesis
      “Calculated Z value” is Greater than “table Z value” (means greater than 1.96
      times of SE at LOS 5%) and we Reject the Null Hypothesis
STANDARD ERROR OF DIFFERENCE BETWEEN TWO MEANS
                          X1 =Mean for Sample 1
                          X2 = Mean for Sample 2
                          SD1 = Standard deviation for
                          Sample 1
                          SD2 = Standard deviation for
                          Sample 2
                          N1 – Sample Size for Sample 1
                          N2 – Sample Size for Sample 2
                              EXAMPLE
⚫ In a nutritional study, 100 children were given usual diet and 100 were
  given vitamin A and D tablets. After 6 months, average weight of group
  A was 29kg with SD of 1.8kg and average weight of group B was 30kg
  with SD of 2kg. Is the difference is significant?
    SD1= 1.8             n1 = 100
    SD2= 2               n2 = 100
⚫ Ho: There is No Significant Difference between mean
  weight in both of the group
⚫ H1: The difference observed in Mean is Significant
⚫ LOS : 0.05
As obtained value of z (3.7) is higher
than critical value (Z Table value at
LOS 5% is 1.96),
The observed difference is significant,
we Reject the Null Hypothesis and
accept the alternate hypothesis and
conclude that vitamins played a role in
weight gain
TEST FOR PROPORTIONS
            Test for Single Proportion
⚫ In a medical college, out of 120 admission of 1st
  MBBS, 35 are girl students. Check whether the
  proportion of girl students is 40% in this college.
                p= proportion of success
⚫ Z=p–P         P = proportion of success in universal population
                q= 100-p
   SE (p)       n = sample size
⚫ Z=p–P
   √pq/n        p= 35*100/120 =29%
                P = 40%
                q = 100-p= 100-29 = 71%
⚫ Z=p–P           As obtained value of z (-2.65) is
                  higher than critical value (Z
   √pq/n
                  Table value at LOS 5% is 1.96),
Z = 29 -40
  √ 29 * 71/120   The   observed      difference     is
                  significant, we Reject the Null
Z= 11/ √ 17.15    Hypothesis    and     accept      the
Z = 11/ 4.14      alternate     hypothesis         and
                  conclude that the proportion of
Z = -2.65
                  girls student is not 40%
STANDARD ERROR OF DIFFERENCE
  BETWEEN TWO PROPORTIONS
                P1: Probability of Success in
                Sample 1
                P2: Probability of Success in
                Sample 2
                Q1 = 100 – P1
                Q2 = 100 – P2
                N1 – Sample Size for Sample 1
                N2 – Sample Size for Sample 2
                      EXAMPLE
⚫ If swine flu mortality in one sample of 100 is 20%
  and in another sample of 100 it is 30%. Is the
  difference in mortality rate is significant?
   P1= 20 Q1 = 80 n1 = 100
   P2= 30 Q2 = 70 n2 = 100
⚫ Ho: There is No Significant Difference between
  Proportion of Mortality both of the Sample
⚫ H1: The difference observed in Proportion of
  Mortality is Significant
⚫ LOS : 0.05
As obtained value of z (1.64) is
lesser than critical value (Z
Table value at LOS 5% is 1.96),
The   observed   difference   is
insignificant, we Accept the
Null Hypothesis and Reject the
alternate    hypothesis     and
conclude     that     Observed
Difference in Mortality is only
by Chance.
                                Example
⚫ In a School A, Tonsillectomy had been done in 23 students out of 50
  while in the other School B it was done in 44 Students out of 200. Is
  this difference is Statistically Significant?
⚫ Ho: There is No Significant Difference between Proportion of
  Tonsillectomy in both of the Sample
⚫ H1: The difference observed in Proportion of Tonsillectomy is
  Significant
⚫ LOS : 0.05
⚫ School A:
n1= 50
P1 (probability of Succeess)= 23/50 *100 = 46%
Q1 = 100- 46= 54%
⚫ School B:
n2= 200
P2 (probability of Succeess)= 44/200 *100 = 22%
Q2 = 100- 46= 88%
Calculate Z= 3.11
As obtained value of z (3.11) is
higher than critical Z value (Z
Table value at LOS 5% is 1.96),
The    observed      difference    is
significant, we Reject the Null
Hypothesis     and     accept     the
alternate      hypothesis         and
conclude difference observed
occurrence of Tonsillectomy is
significant.
                           Home Work..
1.   In a Study on Growth of Children, One group of 100 Children had a
     mean Height of 60 cm and SD of 2.5 cm while another group of 150
     children had a mean height of 62 cm and SD of 3 cm. Is the Difference
     between the two group statistically Significant?
2.   Find the significant of difference in the Mean heights of 50 girls and
     50 Boys with the following Values..
                           Mean            SD           SE
             Girls         147.4 Cm        6.6 cm       0.93
             Boys          151.6 Cm        6.3 cm       0.89
                       Example..
⚫ In a School A, there was a History of Whooping Cough in 25
  students out of 50 while in the other School B History of
  Whooping Cough in 88 Students out of 200. Determine
  Whether the Difference is Due to Chance or Real.
Thank you…