Normality tests P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S - - PowerPoint PPT Presentation

normality tests
SMART_READER_LITE
LIVE PREVIEW

Normality tests P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S - - PowerPoint PPT Presentation

Normality tests P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R Zuzanna Chmielewska Actuary PRACTICING STATISTICS INTERVIEW QUESTIONS IN R Testing normality Statistical tests Shapiro-Wilk test Kolmogorov-Smirnov test Visual


slide-1
SLIDE 1

Normality tests

P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R

Zuzanna Chmielewska

Actuary

slide-2
SLIDE 2

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-3
SLIDE 3

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Testing normality

Statistical tests Shapiro-Wilk test Kolmogorov-Smirnov test Visual measure Q-Q plot

slide-4
SLIDE 4

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Shapiro-Wilk test

slide-5
SLIDE 5

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Shapiro-Wilk test

Razali, Nornadiah; Wah, Yap Bee (2011). "Power comparisons of Shapiro–Wilk, Kolmogorov–Smirnov, Lilliefors and Anderson–Darling tests"

1

slide-6
SLIDE 6

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

P-value

slide-7
SLIDE 7

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Shapiro-Wilk test

slide-8
SLIDE 8

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Kolmogorov-Smirnov test

slide-9
SLIDE 9

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Kolmogorov-Smirnov test

slide-10
SLIDE 10

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Kolmogorov-Smirnov test

slide-11
SLIDE 11

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-12
SLIDE 12

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-13
SLIDE 13

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-14
SLIDE 14

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-15
SLIDE 15

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Transforming data for normality

slide-16
SLIDE 16

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Transforming data for normality

slide-17
SLIDE 17

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Checking normality in R

Method Function Shapiro-Wilk test

shapiro.test(x)

Kolmogorov-Smirnov test

ks.test(x, y = "pnorm")

Q-Q plot

qqnorm(x); qqline(x)

slide-18
SLIDE 18

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Summary

normality tests Shapiro-Wilk test Kolmogorov-Smirnov test p-value Q-Q plot data transformation checking normality in R

slide-19
SLIDE 19

Let's practice!

P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R

slide-20
SLIDE 20

Inference for a mean

P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R

Zuzanna Chmielewska

Actuary

slide-21
SLIDE 21

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Inference for a mean

slide-22
SLIDE 22

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Inference for a mean

condence interval

  • ne-sample mean
slide-23
SLIDE 23

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Assumptions

The t-test's assumptions: normally distributed underlying data (recall CLT!) random sample independent observations

slide-24
SLIDE 24

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Condence interval

slide-25
SLIDE 25

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Condence interval

slide-26
SLIDE 26

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Condence interval

slide-27
SLIDE 27

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Condence interval

slide-28
SLIDE 28

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

95% condence interval

slide-29
SLIDE 29

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

95% condence interval

slide-30
SLIDE 30

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

95% condence interval

slide-31
SLIDE 31

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

95% condence interval

slide-32
SLIDE 32

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

One-sample t-test

H : μ = μ H : μ ≠ μ

where:

μ - the population's mean μ - the hypothesized mean

1

slide-33
SLIDE 33

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

t-test in R

t.test(x)

slide-34
SLIDE 34

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

t-test in R

t.test(x)

slide-35
SLIDE 35

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

t-test in R

t.test(x)

slide-36
SLIDE 36

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

t-test in R

t.test(x, mu = 2)

slide-37
SLIDE 37

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

t-test in R

t.test(x, mu = 2, conf.level = 0.9)

slide-38
SLIDE 38

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Summary

t-test's assumptions condence interval

  • ne-sample t-test

t.test() in R

slide-39
SLIDE 39

Let's practice!

P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R

slide-40
SLIDE 40

Comparing two means

P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R

Zuzanna Chmielewska

Actuary

slide-41
SLIDE 41

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Comparing two means

slide-42
SLIDE 42

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Hypotheses

Two-tailed test:

H : μ = μ H : μ ≠ μ

where:

μ - the rst population's mean μ - the second population's mean

1 2 1 1 2 1 2

slide-43
SLIDE 43

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Assumptions

The two-sample t-test's assumptions: normally distributed underlying data random samples independent observations homogeneity of variances

slide-44
SLIDE 44

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Assumptions

The two-sample t-test's assumptions: normally distributed underlying data random sample independent observations homogeneity of variances - e.g. bartlett.test()

slide-45
SLIDE 45

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-46
SLIDE 46

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-47
SLIDE 47

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-48
SLIDE 48

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-49
SLIDE 49

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-50
SLIDE 50

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-51
SLIDE 51

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-52
SLIDE 52

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-53
SLIDE 53

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-54
SLIDE 54

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Teaching methods

slide-55
SLIDE 55

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-56
SLIDE 56

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-57
SLIDE 57

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-58
SLIDE 58

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-59
SLIDE 59

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-60
SLIDE 60

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

t-test in R

Two-sample t-test

t.test(value ~ group, data = df, var.equal = TRUE)

slide-61
SLIDE 61

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

t-test in R

Two-sample t-test

t.test(value ~ group, data = df, var.equal = TRUE)

Paired t-test

t.test(value ~ group, data = df, paired = TRUE)

slide-62
SLIDE 62

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Summary

two-sample t-test hypotheses assumptions paired t-test

t.test() in R

slide-63
SLIDE 63

Let's practice!

P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R

slide-64
SLIDE 64

ANOVA

P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R

Zuzanna Chmielewska

Actuary

slide-65
SLIDE 65

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-66
SLIDE 66

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Hypotheses

H : μ = μ = ... = μ H : ∃ μ ≠ μ

1 2 n 1 (i,j) i j

slide-67
SLIDE 67

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Hypotheses

H : μ = μ = μ

1 2 3

slide-68
SLIDE 68

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Hypotheses

Two-sample t-test:

H : μ = μ

1 2

slide-69
SLIDE 69

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Hypotheses

H : μ = μ = ... = μ

1 2 n

slide-70
SLIDE 70

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-71
SLIDE 71

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-72
SLIDE 72

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-73
SLIDE 73

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

slide-74
SLIDE 74

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Why not multiple t-tests?

slide-75
SLIDE 75

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Why not multiple t-tests?

slide-76
SLIDE 76

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Why not multiple t-tests?

slide-77
SLIDE 77

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Why not multiple t-tests?

slide-78
SLIDE 78

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Why not multiple t-tests?

slide-79
SLIDE 79

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Assumptions

independence of cases normal distributions homogeneity of variances

slide-80
SLIDE 80

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

ANOVA in R

  • neway.test(value ~ group, data, var.equal = TRUE)
slide-81
SLIDE 81

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Box plot

slide-82
SLIDE 82

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Box plot

slide-83
SLIDE 83

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Box plot

slide-84
SLIDE 84

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Box plot

slide-85
SLIDE 85

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Box plot

slide-86
SLIDE 86

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Box plot

slide-87
SLIDE 87

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Box plot

slide-88
SLIDE 88

PRACTICING STATISTICS INTERVIEW QUESTIONS IN R

Summary

hypotheses of ANOVA type I and II errors assumptions of ANOVA

  • neway.test() in R

box plot

slide-89
SLIDE 89

Let's practice!

P RACTICIN G S TATIS TICS IN TERVIEW QUES TION S IN R