Contingency Tables: Exponential Distributions and Chi-Square Test, Exams of Asian literature

The concepts of contingency tables, continuous goodness of fit models, estimating probabilities, comparing two categorical measurements, marginal totals, expected values, and the exponential distribution. It includes examples of calculating probabilities, expected values, and performing a chi-square test to determine if data follows an exponential distribution.

Typology: Exams

Pre 2010

Uploaded on 09/17/2009

koofers-user-4ui-1
koofers-user-4ui-1 🇺🇸

8 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PSTAT 120C: Contingency Tables May 12, 2009
Continuous goodness of fit models
Estimating probabilities
Comparing two categorical measurements
Marginal totals
Expected values
Exponential Example
I drop a popcorn kernel in hot oil and time how long it takes to pop.
I try this experiment 50 times and the average time in the oil is 2.999 seconds.
The data ranges from 0.14 sec to almost 11 sec.
We break the data into 7 subsets
Range 0–1 1–2 2–3 3–4 4–5 5–6 >6
Counts 7 15 6 11 5 1 5
Probabilities: with a mean of 2.999, P{Xx}= 1 ex/2.999 .
Range 0–1 1–2 2–3 3–4 4–5 5–6 >6
CDF 0.284 0.488 0.633 0.738 0.812 0.866 1
P0.284 0.204 0.145 0.105 0.074 0.054 0.134
E14.2 10.2 7.3 5.2 3.73 2.67 6.721653
new 14.2 10.2 7.3 5.2 6.40 6.7
Counts 7 15 6 11 6 5
Question: Does this follow an exponential distribution?
The X2statistic is 13.07
xx
[1] 3.66081513 2.29041086 0.22541623 6.42993010 0.02494700 0.44097602
The critical value for a χ2with 4 df is 9.48.
Therefore this data does not look quite like an exponential
1
pf3

Partial preview of the text

Download Contingency Tables: Exponential Distributions and Chi-Square Test and more Exams Asian literature in PDF only on Docsity!

PSTAT 120C: Contingency Tables May 12, 2009

  • Continuous goodness of fit models
  • Estimating probabilities
  • Comparing two categorical measurements
  • Marginal totals
  • Expected values

Exponential Example

  • I drop a popcorn kernel in hot oil and time how long it takes to pop.
  • I try this experiment 50 times and the average time in the oil is 2.999 seconds.
  • The data ranges from 0.14 sec to almost 11 sec.
  • We break the data into 7 subsets

Range 0–1 1–2 2–3 3–4 4–5 5–6 > 6 Counts 7 15 6 11 5 1 5

  • Probabilities: with a mean of 2.999, P{X ≤ x} = 1 − ex/−^2.^999.

Range 0–1 1–2 2–3 3–4 4–5 5–6 > 6 CDF 0.284 0.488 0.633 0.738 0.812 0.866 1 P 0.284 0.204 0.145 0.105 0.074 0.054 0. E 14.2 10.2 7.3 5.2 3.73 2.67 6. new 14.2 10.2 7.3 5.2 6.40 6. Counts 7 15 6 11 6 5

  • Question: Does this follow an exponential distribution?
  • The X^2 statistic is 13.

xx [1] 3.66081513 2.29041086 0.22541623 6.42993010 0.02494700 0.

  • The critical value for a χ^2 with 4 df is 9.48.
  • Therefore this data does not look quite like an exponential

Multiple Choice questions

  • A typical survey result has more than just two options. Especially when you include“undecided” or “don’t know” answers.
  • Example X 1 = 423 X 2 = 387 X 3 = 64 Test the hypothesis that H 0 : p 1 = p 2
  • If p 1 = p 2 then the best estimator is

ˆp 1 = ˆp 2 =

X 1 + X 2

2 n

pˆ 3 = 0. 0732

  • Expected values E X 1 = 405 E X 2 = 405 E X 3 = 64
  • χ^2 statistic

X^2 =

(423 − 405)^2

(387 − 405)^2

(64 − 64)^2

  • Degrees of freedom = 3 - 1(total = 874) - 1 (810 in the first two) = 1
  • Critical value is 3.841459 so this is not significant.

In general, testing H 0 : p 1 = p 2 ,

X^2 =

(X 1 − 12 (X 1 + X 2 ))^2

12 (X 1 + X 2 ) +

(X 1 − 12 (X 1 + X 2 ))^2

12 (X 1 + X 2 )

2(X 1 − 12 (X 1 + X 2 ))^2

12 (X 1 + X 2 )

[

X 1 − N/ 2

N ( 12 )( 12 )

] 2

where N = X 1 + X 2. In other words, the test conditions on the total number in those two categories and then does a simple binomial test of whether the proportion is 12.

TV Panels

  • Media Matters for America collected data on the political leanings of guests and political panels on Sunday Talk Shows.
  • The contingency table (a cross classification of the data)