Sunteți pe pagina 1din 39

Inferential statistics

Zarni Amri

Zarni Amri

Inferential statistics

Inference (statistical)

The process of drawing conclusions about a population of observations from a sample of observation

Zarni Amri

Inferential statistics

INFERENCE
population statistics

parameter
m s p

sample

X S P

infert
Zarni Amri Inferential statistics 3

Test Statistics

Number of variables Data scale numeric, category Sample size Sampling methods (paired, unpaired; dependent, independent; related, unrelated)
Inferential statistics 4

Zarni Amri

SIGNIFICANCY STEPS
Determine null hypothesis Determine alternative hypothesis Determine significance level Statistical calculation Probability interpretation

Zarni Amri

Inferential statistics

SOURCES OF DIFFERENCE

POPULATION DIFFERENCE SAMPLING VARIATION


Both components are complementary

Zarni Amri

Inferential statistics

Pop A
Sp1

X1

S1

P1

Sampling variation
Sp2

X2

S2

P2

Pop B
Sp3

Pop Difference

X3

S3

P3

Zarni Amri

Inferential statistics

NULL HYPOTHESIS
Presumption of innocence Sampling variation role No group difference
A=B RR = 1 OR = 1
Zarni Amri Inferential statistics 8

ALTERNATIVE HYPOTHESIS
Depends on study direction Two tailed test A = B RR = 1

One tailed test A>B A<B RR > 1 or RR < 1


Zarni Amri Inferential statistics 9

Two tailed test

One tailed test


Zarni Amri Inferential statistics 10

SIGNIFICANCE LEVEL
Sampling variation level Type one error (false +) Type two error (false -) Depends on sample size Depends on seriousness

Zarni Amri

Inferential statistics

11

Hypotheses Testing
ACTUAL
Signific (+) Not Sign. (-)

Signific (+) (Reject H0)

TEST
Not Sign. (-) (Accept H0)
Zarni Amri

POWER (1-) True positive Type II error ( )

Type I error () CON.LEVEL (1- ) 12 True negative

Inferential statistics

SIGNIFICANCE TEST
To conclude whether samples difference is also true for population

PARAMETRIC METHODS NON PARAMETRIC METHODS


Zarni Amri Inferential statistics 13

BASIC PRINCIPLE
No perfect test Only most appropriate test Based on data and design

Should know all test types

Zarni Amri

Inferential statistics

14

PARAMETRIC TESTS
Based on parameters Numerical data More sensitive tests

Normal distribution Random sample derivation No extremes value


Zarni Amri Inferential statistics 15

NON PARAMETRIC TESTS


No requirement needed Categorical data Numerical but not normally distributed Could be applied to all conditions

Rather less sensitive tests Second choices


Zarni Amri Inferential statistics 16

PARAMETRIC TESTS
Difference of two means (Big and small samples) ( independent and paired samples )
Analysis of variance Correlation & regression Analysis of covariance
Zarni Amri Inferential statistics 17

Choosing statistical test for two variables


Data scale
Nominal

unrelated

related
Mc. Nemar test

correlation and regression


Logistic Regression

X2 (2x2) Fisher exact test KolmogorovSmirnov test Mann-Whitney Utest


unpaired t-test

Ordinal

- Uji Sign - Uji Wilcoxon matchedpaired

Spearman test

Numerik

paired t-test

- Pearson correlation - Linear reression


- Multiple regression

Zarni Amri

Inferential statistics

18

Choosing statistical test for two variables


Data scale unrelated related

Nominal Ordinal Numeric

X2 (rxc) Kruskal-Wallis test

Cochran Q test Friedman test

Anova

Anova related

Zarni Amri

Inferential statistics

19

Is there any difference between mean age of shift and non shift worker?
Group Statistics Std. Error Mean .86 .58 Kerja gilir tidak ya N 89 88 Mean 35.39 29.42 Std. Deviation 8.08 5.42

Usia responden

T ests of Normality Kolm ogorov-Smi rnov Stati sti c df Si g. .113 88 .008 .186 89 .000
a

Usi a responden

Kerj a gil i r ya ti dak

a. Li ll i efors Si gni fi cance Correction

95% CI = mean + 1.96 SE = 35.39 + 1.96 x 8.08/89 =

Zarni Amri

Inferential statistics

20

T ests of Normality Kolm ogorov-Smi rnov Stati sti c df Si g. .146 177 .000
a

Usi a responden

a. Li ll i efors Si gni fi cance Correcti on

Tests of Normality Kolmogorov-Smirnov Statistic df Sig. .186 89 .000 .113 88 .008


a

Usia responden

Kerja gilir tidak ya

a. Lilliefors Significance Correction


a T e s t Sta tistic s

M an n Wh itn e y U Wil coxon W Z As ym p . Si g . (2 -tai l e d)

Us ia re s po n de n 2 12 1 .50 0 6 03 7 .50 0 -5 .2 7 4 .0 00

a . Gro up i n g Va ria b l e: Ke r j a gi l i r

Zarni Amri

Inferential statistics

21

Have you ever been this tired???

Zarni Amri

Inferential statistics

22

Hypothesis Testing

Univariat Bivariat Multi variate

Zarni Amri

Inferential statistics

23

Bivariat: numeric vs cathegoric

E.g. To compare mean of Blood Pressure (numeric) in two groups: with therapy and without T/ PARAMETRIK - 2 mean : t-distribution test - > 2 mean : ANOVA NON PARAMETRIK - 2 mean : Mann Whitney - > 2 mean : Kruskal Wallis
Inferential statistics 24

Zarni Amri

numeric vs category
Group Statistics Std. Error Mean .86 .58 Usia responden Kerja gilir tidak ya N 89 88 Mean 35.39 29.42 Std. Deviation 8.08 5.42

Tests of Normality Kolmogorov-Smirnov Statistic df Sig. .186 89 .000 .113 88 .008


a

Test Statisticsa Usia responden 2121.500 6037.500 -5.274 .000

Usia responden

Kerja gilir tidak ya

a. Lilliefors Significance Correction

Mann-Whitney U Wilcoxon W Z Asymp. Sig. (2-tailed)

a. Grouping Variable: Kerja gilir

Zarni Amri

Inferential statistics

25

Example paired t-test


Pre-intervention LDL 177,3 + 31,8 mg/dL Post-intervention LDL 155,6 + 32,5mg/dL

H1: Intervention LDL


Paired sample (pre-post intervention) Distribution : KS normal

paired t-test, =0,05, p<0,001

Rejecting Ho
conclusion: accepted H1

Intervention lowering LDL


Zarni Amri Inferential statistics 26

numeric vs numeric
UJI 2 PAIRED MEANS
Paired Samples Statistics Std. Error Mean 5.8013 5.9389

Pair 1

LDL pre LDL post

Mean 174.2667 155.6333

N 30 30

Std. Deviation 31.7750 32.5285

Tests of Normality Kolmogorov-Smirnov Statistic df Sig. .127 30 .200* .130 30 .200*


a

LDL pre LDL post

Shapiro-Wilk Statistic df .971 30 .958 30

Sig. .591 .372

*. This is a lower bound of the true significance. a. Lilliefors Significance Correction


Zarni Amri Inferential statistics 27

Test : 2 PAIRED MEANS


Paired Samples Statistics Std. Error M ean 5.2506 6.4586

Pair 1

SBP1 SBP2

M ean 190.3636 166.3636

N 11 11

Std. Devi ation 17.4142 21.4209

Paired Samples Correlations N Pair 1 SBP1 & SBP2 11 Correlation .792 Sig. .004

Paired Samples Test Paired Differences 95% Confidence Interval of the Difference Lower Upper 15.2047 32.7953

Pair 1

SBP1 - SBP2

Mean 24.0000

Std. Deviation 13.0920

Std. Error Mean 3.9474

t 6.080

df 10

Sig. (2-tailed) .000

Zarni Amri

Inferential statistics

28

Group Statistics Std. Error M ean 5.25 6.46

SBP

GROUP Pl acebo HCT

N 11 11

M ean 190.36 166.36

Std. Devi ati on 17.41 21.42

Independent Samples Test SBP Equal variances Equal variances assumed not assumed .089 .769 2.883 2.883 20 19.200 .009 .009 24.00 8.32 Lower Upper 6.64 41.36 24.00 8.32 6.59 41.41

Levene's Test for F Equality of Variances Sig. t-test for Equality of t Means df Sig. (2-tailed) Mean Difference Std. Error Difference 95% Confidence Interval of the Difference

Zarni Amri

Inferential statistics

29

Independent Samples Test Levene's Test for Equality of Variances

t-test for Equality of Means 95% Confidence Interval of the Difference Lower Upper 6.64 6.59 41.36 41.41

F SBP Equal variances assumed Equal variances not assumed .089

Sig. .769

t 2.883 2.883

df 20 19.200

Mean Sig. (2-tailed) Difference .009 .009 24.00 24.00

Std. Error Difference 8.32 8.32

Zarni Amri

Inferential statistics

30

Category >< Category, 2x2 table


Ke rj a gilir * Ins omnia /buk a n Cross ta bulation In s om ni a /bu k an ti da k ya 34 55 3 8.2 % 6 1.8 % 19 69 2 1.6 % 7 8.4 % 53 1 24 2 9.9 % 7 0.1 % Ke rj a g i li r ti da k ya T o ta l Co un t % wi th in Ke rj a gi l i r Co un t % wi th in Ke rj a gi l i r Co un t % wi th in Ke rj a gi l i r T o ta l 89 1 00 .0 % 88 1 00 .0 % 1 77 1 00 .0 %

Chi-Square Tests Asym p. Sig. (2-sided) .016 .025 .015 Exact Sig. (2-sided) Exact Sig. (1-sided)

Pearson Chi-Square a Continuity Correction Likelihood Ratio Fisher's Exact Test Linear-by-Linear Association N of Valid Cases

Value 5.820 b 5.056 5.882

df 1 1 1

.021 5.788 177 1 .016

.012

a. Computed only for a 2x2 table b. 0 cells (.0%) have expected count less than 5. The m inim um expected count is 26.35.

Zarni Amri

Inferential statistics

31

SPSS
Correlations age type A personality 1.000 . 16 .040 .884 16 age type B personality .040 .884 16 1.000 . 17

age type A personality Pearson Correlation Sig. (2-tailed) N age type B personality Pearson Correlation Sig. (2-tailed) N

Zarni Amri

Inferential statistics

32

Correlations Rest Bl ood Pressure type A personal i ty .440 .088 16 1.000 . 16

age type A personal i ty Pearson Correl ati on Si g. (2-tai l ed) N Rest Bl ood Pressure Pearson Correl ati on type A personali ty Si g. (2-tai l ed) N

age type A personal i ty 1.000 . 16 .440 .088 16

Descriptiv e Statistics M ean 42.25 129.06 Std. Devi ati on 9.35 18.90 N 16 16

age type A personal i ty Rest Bl ood Pressure type A personal i ty

Zarni Amri

Inferential statistics

33

Pearson >< Mann Whitney reasons


Correlations Anaemi a haemoglobin s tatus Anaemi a s tatus

haemoglobin
Age (years )

Pears on Correl ati on Si g. (2-tai l ed) N Pears on Correl ati on Si g. (2-tai l ed) N

1.000 . 279 .003 .958 279

Age (years ) .003 .958 279 1.000 . 279

Correlations Anaemia status 1.000 . 279 .035 .560 279

Spearman's rho

haemoglobin
Age (years)

Anaemia status

Correlation Coefficient Sig. (2-tailed) N Correlation Coefficient Sig. (2-tailed) N

Age (years) .035 .560 279 1.000 . 279

Zarni Amri

Inferential statistics

34

Numerical vs Categorical

E.g. age between shift-non-shift workers NORMALLY DISTRIBUTED


-

2 groups > 2 groups

: t-distribution test : ANOVA

NOT NORMALLY DISTRIBUTED


-

2 groups > 2 groups

: Mann Whitney : Kruskal Wallis

Zarni Amri

Inferential statistics

35

t test? Reasons?
Group Statistics Std. Error M ean 2.34 3.25 4.72 6.14

age Rest Bl ood Pressure type A personal ity

GRUP A B A B

N 16 17 16 17

M ean 42.25 37.88 129.06 127.41

Std. Devi ation 9.35 13.40 18.90 25.32

Independent Samples Test Levene's Test for Equality of Variances

t-test for Equality of Means 95% Confidence Interval of the Difference Lower Upper -3.88 -3.82 -14.29 -14.18 12.62 12.56 17.59 17.49

F age Equal variances assumed Equal variances not assumed Equal variances assumed Equal variances not assumed 2.775

Sig. .106

t 1.080 1.091

df 31 28.657 31 29.516

Sig. (2-tailed) .289 .284 .834 .833

Mean Difference 4.37 4.37 1.65 1.65

Std. Error Difference 4.05 4.00 7.82 7.75

Rest Blood Pressure type A personality

.745

.395

.211 .213

Zarni Amri

Inferential statistics

36

paired t-test? why ?


Paired Samples Statistics Std. Error M ean 5.2506 6.4586

Pair 1

SBP1 SBP2

M ean 190.3636 166.3636

N 11 11

Std. Devi ation 17.4142 21.4209

Paired Samples Correlations N Pair 1 SBP1 & SBP2 11 Correlation .792 Sig. .004

Paired Samples Test Paired Differences 95% Confidence Interval of the Difference Lower Upper 15.2047 32.7953

Pair 1

SBP1 - SBP2

Mean 24.0000

Std. Deviation 13.0920

Std. Error Mean 3.9474

t 6.080

df 10

Sig. (2-tailed) .000

Zarni Amri

Inferential statistics

37

Cathegoric vs Cathegoric

Rows x Column 2 x 2 table

eg. smoking exposure vs lung cancer No NOL cell No cell with expected value <5

CHI-SQUARE

FISHER
Inferential statistics 38

Zarni Amri

Chi-square test or fishers exact test Why ?

Ca t e gor y Age * Cate gory of Blood Pr es s ure Cross tabulation Co un t Ca te g ory o f Bl oo d Press ure <= 1 40 >14 0 17 2 6 8 23 10

Ca te g ory Ag e T o ta l

<= 4 0 > 40

T o ta l 19 14 33

Chi-Square T ests Asym p. Si g. (2-si ded) .004 .013 .003 Exact Si g. (2-si ded) Exact Si g. (1-si ded)

Pearson Chi -Square a Conti nui ty Correction Li kel i hood Rati o Fi sher's Exact T est Li near-by-Li near Associ ati on N of Val i d Cases

Value 8.294 b 6.233 8.577

df 1 1 1

.007 8.042 33 1 .005

.006

a. Computed onl y for a 2x2 table b. 1 cell s (25.0%) have expected count less than 5. T he mi nim um expected count i s 4.24.

Zarni Amri

Inferential statistics

39

S-ar putea să vă placă și