lecture 10 tests for proportions

15
LECTURE 10 TESTS FOR PROPORTIONS EPSY 640 Texas A&M University

Upload: appollo-kristin

Post on 31-Dec-2015

25 views

Category:

Documents


0 download

DESCRIPTION

LECTURE 10 TESTS FOR PROPORTIONS. EPSY 640 Texas A&M University. TESTS FOR PROPORTIONS. Proportions involve Nominal scale data Univariate case 1 sample k samples Bivariate case association agreement. 1 Sample case. Proportion = k/n where k= # in category of interest, n=sample size - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: LECTURE 10 TESTS FOR PROPORTIONS

LECTURE 10TESTS FOR PROPORTIONS

EPSY 640

Texas A&M University

Page 2: LECTURE 10 TESTS FOR PROPORTIONS

TESTS FOR PROPORTIONS

• Proportions involve Nominal scale data• Univariate case

* 1 sample

* k samples

• Bivariate case* association

* agreement

Page 3: LECTURE 10 TESTS FOR PROPORTIONS

1 Sample case• Proportion = k/n where k= # in category of

interest, n=sample size• Var (p) = p(1-p)/n = pq/n,

where p= proportion, n= # in sample, and q=1-p

• If you have a single case, then Var(p)=p(1-p) = pq

• ex. Single roll of two dice, getting a 7 has p=1/6, so for a single roll, Var(p)=1/6*5/6 = 5/36, SD=sqrt(5/36) = .373

Page 4: LECTURE 10 TESTS FOR PROPORTIONS

1 Sample p Confidence Interval

• The confidence interval due to Ghosh is

• p [n/(n+z2){ p + z2/2n z pq/n + z2/rn2}

• ex. The probability of admission to med school is .08 for applicants. The 95% confidence interval around a single case is

(.01, .81)

• For the roll of a 7, the 95% CI is (.005, .846)

Page 5: LECTURE 10 TESTS FOR PROPORTIONS

p z n n/(n+z*z) p+z*z/2n) z(pq/n+z*z/4n*n LL UL0.08 1.96 1 0.206543 2.0008 1.993041495 0.001602 0.824901

0.08 1.96 1 =C2/(C2+B2 2̂) =A2+B2 2̂/2*C2 =B2*SQRT(A2*(1-A2)/C2 + B2 2̂/(4*C2 2̂))=D2*(E2-F2) =D2*(E2+F2)

Excel formulas for confidence interval around a single

proportion

Page 6: LECTURE 10 TESTS FOR PROPORTIONS

Testing k independent proportions

• For k categories with pi = proportion in category i and p1+p2+...pk=1

, we can test 1. All proportions are the same

2. Each pi = i based on theory or previous data

Page 7: LECTURE 10 TESTS FOR PROPORTIONS

Testing k independent proportions

• For k categories with pi = proportion in category i and p1+p2+...pk=1

• All proportions are the same p.=1/k:

X2 = N[(p1 - p.)2/p. + (p2-p.)2/p.+...(pk-p.)2/p.]

with degrees of freedom k-1

ex. The reported proportions of ethnic groups in Bryan is .33 Caucasian, .42 Hispanic, and .25 African American with 8000 students. The chi square is 347.2 with 2df. This is significant at p=.0001

Page 8: LECTURE 10 TESTS FOR PROPORTIONS

Testing k independent theoretical proportions

• For k categories with pi = proportion in category i and p1+p2+...pk=1, each proportion tested against a theoretical value i

X2 = N[(p1 - 1 )2/ 1 +(p2- 2 )2/ 2 +...(pk- k)2/k ]

with degrees of freedom k-1ex. The reported proportions of ethnic groups in Bryan is .33

Caucasian, .42 Hispanic, and .25 African American with 8000 students. National proportions are .74, .14, and .12.

The chi square is 7423.9 with 2df. This is significant at p=.0001

Page 9: LECTURE 10 TESTS FOR PROPORTIONS

Bivariate Association

• Two nominal variables are measured for N persons (eg. Gender and aggression status)

• An R x C table of proportions is computedprc = proportion for row r, column c

• Then, the sum of a row of proportions is pr. and for a column the sum is p.c

• Association is defined as departure from average expected proportion for each cell cumulated over the cells

Page 10: LECTURE 10 TESTS FOR PROPORTIONS

Chi Square Association

• For an R x C table of proportions with the sum of all cell proportions equal to 1.0,

X2 = N[(p11 - p1.p.1)2/ p1.p.1 +(p12- p1.p.2 )2/ p1.p.2 +...(prc- pr.p.c )2/ pr.p.c ]

with (R-1)(C-1) degrees of freedom

Page 11: LECTURE 10 TESTS FOR PROPORTIONS

Chi Square Association

• For an R x C table of proportions with the sum of all cell proportions equal to 1.0,

X2 = SUM [ (Oij – Eij ]2 / Eij

Eij = expected cell count based on row and column averages, = N*p.j*pi.

16 12 22

11 23 10

50

44

27 35 32

Page 12: LECTURE 10 TESTS FOR PROPORTIONS

16 12 22 50

11 23 10 44

27 35 32 94

0.152784 0.198053 0.181077 expected

0.13445 0.174287 0.159348 cell p's

14.3617 18.61702 17.02128 expected

12.6383 16.38298 14.97872 cell n's

0.186887 2.351878 1.456277 chi square

0.212372 2.672589 1.65486 cell values

X2 = 8.534863

prob = 0.014018

OBSERVED CELLS

DEM REP INDM

F

X2(2,.05)=5.99

Page 13: LECTURE 10 TESTS FOR PROPORTIONS

Chi Square Distribution

X2 = zi2, where zi= z-score for score I

Page 14: LECTURE 10 TESTS FOR PROPORTIONS

SCHOOL AAP HP WP N AANP HNP WNP1 88.2 89.5 100 558 27 21 482 75 72.9 62.5 463 31 62 6

133 105 268 506108 209 17 334241 314 285 840

ROWTOT1 0.158333 0.125 0.319048 0.6023812 0.128571 0.24881 0.020238 0.397619

COLTOT 0.286905 0.37381 0.339286 1

TAAS PASS % ETHNIC %

TAAS PASS N

TAAS PASS PROPORTIONS

Question: Is school passing rate related to ethnicity?

Page 15: LECTURE 10 TESTS FOR PROPORTIONS

AA HISP WHITE ROWTOTSCH 1 0.158333 0.125 0.319048 0.602381SCH 2 0.128571 0.24881 0.020238 0.397619COLTOT 0.286905 0.37381 0.339286 1 EXP-AA EXP-H EXP-W

0.172826 0.225176 0.053720.114079 0.148634 0.134906

0.001215 0.044566 1.3104670.001841 0.067516 0.097466

X2 = 1279.381

N=840

TAAS % PASSING

Expected %(TAAS% - Expected)2 /Expected

Chi Square statistic

significant p< .001

Conclusion: school is associate with ethnic TAAS pass rate