Hypothesis Testing
First import files: cs2m, grades,
wmps, wmpl, mws, mwl, kw
Next: install.packages(“psych”)
1
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
One Sample t test
File: cs2m.csv [Ho: Mean Age = 40]
2
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
Paired Sample t test
File: grades.csv [Ho: Mean Quiz1 –
Mean Quiz 2 = 0]
3
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
Paired Sample t test
File: grades.csv [Ho: Mean Quiz1 –
Mean Quiz 2 = 0]
4
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
Independent Samples t test {assuming
unequal variance}
File: cs2m.csv [Ho: Mean BP across
Anxiety Levels are same]
5
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
Independent Samples t test {assuming
equal variance}
File: cs2m.csv [Ho: Mean BP across
Anxiety Levels are same]
6
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
One Sample Proportion Test
A researcher believes that market size of diesel cars is 30%. For testing his
belief, he had taken a sample of 130 cars and found 50 diesel cars.
Ho: p=0.30
7
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
Two Samples Proportion Test
A researcher has found 10 stressed faculties out of a sample of 40 at Christ
college and 22 out of 50 at St. John.
Ho: p1-p2 = 0
8
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
One Way ANOVA
Data of sales in 6 cities [Ho: All sales are same]
Type sale = 22, 22.5…….21, 20
Type city = c(rep(“A”,6),…….rep(“D”,6))
Type sc = data.frame(sale,city)
Type sc and press ENTER [You will see data as shown in next
slide]
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
9
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
10
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
11
Chi-Square Test
File: cs2m [Ho: There is no association
between Anxiety and Drug Reaction
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
12
Chi-Square Test
File: cs2m [Ho: There is no association
between Anxiety and Drug Reaction
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
13
Wilcoxon Matched Paired (Small Sample)
File: wmps [Ho: Md = 0]
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
14
Wilcoxon Matched Paired (Large Sample)
File: wmpl [Ho: Md = 0]
First install.packages(“exactRankTests”)
Type library(exactRankTests)
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
15
Mann-Whitney (Small Sample)
File: mws [Ho: Md = 0]
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
16
Mann-Whitney (Large Sample)
File: mws [Ho: Md = 0]
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
17
Kruskal Wallis
File: kw
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
18
Friedman ANOVA
File: fm.xlsx
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
19
Friedman ANOVA
File: fm.xlsx
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
20
Friedman ANOVA
File: fm.xlsx
Dr Vinod on Hypothesis Testing,
8971073111, vinod@inurture.co.in
21

Hypothesis Testing

  • 1.
    Hypothesis Testing First importfiles: cs2m, grades, wmps, wmpl, mws, mwl, kw Next: install.packages(“psych”) 1 Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in
  • 2.
    One Sample ttest File: cs2m.csv [Ho: Mean Age = 40] 2 Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in
  • 3.
    Paired Sample ttest File: grades.csv [Ho: Mean Quiz1 – Mean Quiz 2 = 0] 3 Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in
  • 4.
    Paired Sample ttest File: grades.csv [Ho: Mean Quiz1 – Mean Quiz 2 = 0] 4 Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in
  • 5.
    Independent Samples ttest {assuming unequal variance} File: cs2m.csv [Ho: Mean BP across Anxiety Levels are same] 5 Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in
  • 6.
    Independent Samples ttest {assuming equal variance} File: cs2m.csv [Ho: Mean BP across Anxiety Levels are same] 6 Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in
  • 7.
    One Sample ProportionTest A researcher believes that market size of diesel cars is 30%. For testing his belief, he had taken a sample of 130 cars and found 50 diesel cars. Ho: p=0.30 7 Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in
  • 8.
    Two Samples ProportionTest A researcher has found 10 stressed faculties out of a sample of 40 at Christ college and 22 out of 50 at St. John. Ho: p1-p2 = 0 8 Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in
  • 9.
    One Way ANOVA Dataof sales in 6 cities [Ho: All sales are same] Type sale = 22, 22.5…….21, 20 Type city = c(rep(“A”,6),…….rep(“D”,6)) Type sc = data.frame(sale,city) Type sc and press ENTER [You will see data as shown in next slide] Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 9
  • 10.
    Dr Vinod onHypothesis Testing, 8971073111, vinod@inurture.co.in 10
  • 11.
    Dr Vinod onHypothesis Testing, 8971073111, vinod@inurture.co.in 11
  • 12.
    Chi-Square Test File: cs2m[Ho: There is no association between Anxiety and Drug Reaction Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 12
  • 13.
    Chi-Square Test File: cs2m[Ho: There is no association between Anxiety and Drug Reaction Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 13
  • 14.
    Wilcoxon Matched Paired(Small Sample) File: wmps [Ho: Md = 0] Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 14
  • 15.
    Wilcoxon Matched Paired(Large Sample) File: wmpl [Ho: Md = 0] First install.packages(“exactRankTests”) Type library(exactRankTests) Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 15
  • 16.
    Mann-Whitney (Small Sample) File:mws [Ho: Md = 0] Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 16
  • 17.
    Mann-Whitney (Large Sample) File:mws [Ho: Md = 0] Dr Vinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 17
  • 18.
    Kruskal Wallis File: kw DrVinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 18
  • 19.
    Friedman ANOVA File: fm.xlsx DrVinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 19
  • 20.
    Friedman ANOVA File: fm.xlsx DrVinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 20
  • 21.
    Friedman ANOVA File: fm.xlsx DrVinod on Hypothesis Testing, 8971073111, vinod@inurture.co.in 21