Docsity

Correlation - Intermediate Statistical Methods | BIOS 662, Study notes of Data Analysis & Statistical Methods

Partial preview of the text

Download Correlation - Intermediate Statistical Methods | BIOS 662 and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity!

Regression III

Bios 662

Michael G. Hudgens, Ph.D.

[email protected]

http://www.bios.unc.edu/∼mhudgens

2006-10-31 12:

Outline

  • Measures of association
  • Parametric/large N
    • Pearson correlation coefficient
  • Nonparametric (i.e., rank based)
    • Spearman rank correlation coefficient
    • Kendall’s τ

Correlation

  • Estimate ρ by

r =

i(Xi^ −^

X¯)(Y

i −^

Y¯ )

i(Yi^ −^

Y¯ )^2

i(Xi^ −^

X¯)^2

[XY ]

[X^2 ][Y 2 ]

sample Pearson product moment correlation coeffi-

cient

  • Can show

r = βˆY ·X

sX sY

= sign( βˆY ·X )

r^2

where r^2 is as in previous set of slides, i.e., the propor-

tion of total variation attributable to regression

Correlation

  • The correlation coefficient r has the following properties
  • r ∈ [− 1 , 1]
  • r = 1 iff all obs on a straight line with pos slope
  • r = −1 iff all obs on a straight line with neg slope
  • invariant under multiplication and addition of constants

to X or Y

  • measures linear association between two variables
  • tends to be close to zero if no linear association

Correlation: Figure 9.

l l l l

l l l l

a. r= l l l l l l l l

b. r=− l

l

l l l

l l l l l

l

lll

l l l

l

l

l

l

l l l l

l l l l

l l

l l l

l

l l

l

l l

l

l

l l

l l l l

l l l l l l

l l l

l l

l l

l l ll

l l l

l

ll l l l ll

l

l (^) l

l

c. r=

l l

l

ll

l l

l

l

l

l l

l l

l

l

l l

l l

d. 0<r<

l

l l

l l (^) l

l

l

l l

l

l

l l

l

l l

l

l l

e. −1<r<

l

l l l l

l l l l

l

l

l ll^ l l

l l l

l

f. r=

l ll^ l l l

l l l ll l ll l (^) ll l l (^) l

l

g. 0<r<

l l

l

l

ll ll

l

l l

l

l

l

l

l l

l l l

h. 0<r< l l^ l l l l l^

l l

l

l ll^ llll^ l^ ll l l l^ l lll l l l

i. −1 < r < 0

Correlation

  • The test statistic

t =

r √ (1 − r^2 )/(N − 2)

∼ tN − 2

can be used to test H 0 : ρ = 0

  • Claim: this test is equivalent to testing H 0 : βY ·X = 0
  • Proof of claim on next slides

Correlation

  • Then

t =

βˆY ·X sY ·X /

[X^2 ]

[XY ]/[X^2 ] sY ·X /

[X^2 ]

[XY ]/

[X^2 ] sY ·X =^

r

[Y 2 ] sY ·X

rsY

√ √ N^ −^1 (1−r^2 )s^2 Y (N −1)/(N −2)

= √ r (1−r^2 )/(N −2)

Correlation

  • That

t =

r √ (1 − r^2 )/(N − 2)

∼ tN − 2 (1)

holds exactly if

  1. (X, Y ) bivariate normal, or
  2. Y |X normal with constant variance (i.e., the usual

regression model holds)

  • (1) holds in general for large N (cf Graybill 1976, Section

6.10)

Correlation: SAS

proc corr; var x y;

Pearson Correlation Coefficients, N = 100 Prob > |r| under H0: Rho=

x y

x 1.00000 0.

y 0.25000 1.

Correlation using Fisher’s Transformation

  • R. A. Fisher developed a test of H 0 : ρ = ρ 0
  • He showed

zr =

log

1 + r

1 − r

∼ N

log

1 + ρ

1 − ρ

N − 3

  • Under H 0 : ρ = ρ 0

z =

1 2 log

1+r 1 −r

− 12 log

1+ρ 0 1 −ρ 0

1 /(N − 3)

∼ N (0, 1)

Correlation using Fisher’s Transformation: Example

  • Cholesterol example
  • N = 100, r =. 25
  • H 0 : ρ = 0

zr =

log

z =

p = 2 ∗ { 1 − Φ(2.515)} = 0. 0119

Correlation using Fisher’s Transformation

  • The Fisher transformation can be used for a CI for ρ

zL = zr − z 1 −α/ 2

1 /(N − 3)

zU = zr + z 1 −α/ 2

1 /(N − 3)

rL =

e^2 zL^ − 1

e^2 zL^ + 1

; rU =

e^2 zU^ − 1

e^2 zU^ + 1

Correlation using Fisher’s Transformation: SAS

proc corr fisher(biasadj=no); var x y; run;

Pearson Correlation Statistics (Fisher’s z Transformation)

With Sample Variable Variable N Correlation Fisher’s z

x y 100 0.25000 0.

Pearson Correlation Statistics (Fisher’s z Transformation)

With p Value for Variable Variable 95% Confidence Limits H0:Rho=

x y 0.056350 0.425524 0.

Correlation using Fisher’s Transformation: R

cor.test(x,y)

Pearson’s product-moment correlation

data: x and y t = 2.556, df = 98, p-value = 0. alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.05634962 0. sample estimates: cor