STAT 211 Topic 8

From Notes
Jump to navigation Jump to search
Lecture 16 Notes

« previous | Tuesday, April 5, 2011 | next »


Comparing 2 Samples

In topic 7, we did confidence intervals and hypothesis tests for a single sample with the population. Now we're comparing 2 samples with each other.

  • Two samples (X1..m and Y1..n) must be independent and from separate populations


Look at difference in averages X¯Y¯ for estimate of difference of means μXμY and compare these with the proposed difference Δ0:

E(X¯Y¯)=E(X¯)+E(Y¯)=μXμYV(X¯Y¯)=V(X¯)+V(Y¯)=σX2m+σY2n

Cases 1&2: Normal Population or Large Sample

When the sample sizes are large, the distribution of X¯Y¯ is also Normal.

Use the same methods as in STAT 211 Topic 7, substituting μ=μXμY, μ0=Δ0 and σ2=σX2m+σY2n.

X¯Y¯Normal(μXμY, σX2m+σY2n)z=X¯Y¯Δ0σX2m+σY2n


Example

A realtor from the northeast claims that houses are more valuable (higher sales price) than anywhere else in the US.

  • μ1: average sales price in Northeast
  • μ2: average sales price anywhere but Northeast
  • H0:μ1μ2=0
  • Ha:μ1μ2>0
  • z=X¯Y¯0sX2/m+sY2/n


Case 3: Small Sample from Normal Population

We do different things depending on the two population variances (not necessarily known):

{σX2=σY2pooledttestσX2σY2unpooledttest

If smaller σ is greater than half of the bigger σ, then we say that they are the same:

σ1>σ22

Pooled Sample Variance

sp2=(m1)sX2+(n1)sY2n+m2

Use t-test as normal with df ν=n+m2

t=X¯Y¯Δ0sp1m+1n

Unpooled Sample Variance

t-test would be normal as expected, but degrees of freedom is more complicated (this is why the pooled test is more common):

t=X¯Y¯Δ0sp1m+1nν=(sX2m+sY2n)2(sX2/m)2m1+(sY2/n)n1


Paired Data

When two samples are related to each other by a third variable (e.g. mother of two children, student who takes two exams, etc.)

Use paired t-test:

  1. calculate differences between samples: Di=XiYi
  2. calculate average and standard deviation of the differences
  3. use regular t-test on t=D¯Δ0sD/n


Confidence Interval

D¯±tα/2, n1sDn


Comparing Two Population Proportions

Lecture 17 Notes

Given two sample proportions p^X and p^Y from two different populations

We are interested in the difference between the two proportions (Normal distribution). Therefore, we can standardize and perform a z-test with the following parameters:

  • H0: pXpY=Δ0
  • Ha: {pXpYpX>pYpX<pY
  • Test Statistic: z=p^Xp^YΔ0p^(1p^)(1m+1n)

The only problem is that we don't know pX and pY so we estimate it with the second equation.

p^=mm+np^1+nm+np^2


Review

(See STAT 211 Topic 3→)

In general, the exact distribution of our sample proportions are Binomial:

p^1=i=1mXimp^2=i=1nYin i=1mXiBin(m,p1)i=1nYiBin(m,p2)
E(i=1mXi)=mp1E(i=1nYi)=mp2 V(i=1mXi)=mp1(1p1)V(i=1nYi)=mp2(1p2)

p^1p^2Normal(p1p2, p1(1p1)m+p2(1p2)n)


Comparing Two Variances

Instead of using χ2 distribution, we use F distribution (F-test).

If we have two samples X1,,Xm and Y1,,Yn

  • H0: σX2=σY2
  • Test statistic: F=sX2sY2

Rejection Range:

Ha Reject H0 if
σX2>σY2 F>Fa, m1, n1
σX2<σY2 F<Fa, m1, n1
σX2σY2 F>Fa/2, m1, n1 or F<F1a/2, m1, n1


Confidence Interval

(sX2/sY2Fa/2, m1, n1, sX2/sY2F1a/2, m1, n1)