michael c. whitlock • dolph schluter analisi …pugliese/statdott/regressione.pdfauthor andrea...

18
17 | 1 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010 ANALISI STATISTICA DEI DATI BIOLOGICI Capitolo 17: La regressione Michael C. Whitlock • Dolph Schluter

Upload: vanthuy

Post on 24-Feb-2019

248 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 1 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

ANALISI STATISTICA DEI DATI BIOLOGICI

Capitolo 17: La regressione

Michael C. Whitlock • Dolph Schluter

Page 2: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 2 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Page 3: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 3 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Pigmento nero sul naso ed età dei leoni

Page 4: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 4 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Procedura in forma grafica per la retta dei minimi quadrati.

Page 5: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 5 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Linear regressionWith bivariate data, we can choose to predict Y on the basis of X :

Y = α+ βX + ε (ε error).

For each value xi of X , there are:

yi (observed value) and yi = α+ βxi (predicted value).

α and β are chosen to minimize�n

i=1(yi − yi )2.

20 30 40 50 60 70 80

100

120

140

160

180

200

220

A regression

eta

pressione

obs. - pred.β =

�ni=1(yi − y)(xi − x)�n

i=1(xi − x)2

α = y − βx .

Formulae similar to correlation,

but interpretation very different.

Page 6: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 6 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

L’ipotesi della regressione in forma grafica

Page 7: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 7 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Il significato dei parametri

Page 8: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 8 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

La retta di regressione dell’età sul pigmento del naso

Page 9: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 9 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Incertezza nella previsione della media e del singolo valore

Page 10: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 10 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Decomposizione della varianza e R2

La varianza (SS= Sum of Squares) totale viene divisa fra quella“spiegata” dal modello e quella residua

SStotal = SSmodel + SSresidual.

SStot =n�

i=1

(yi−y)2 SSmod =n�

i=1

(yi−y)2 SSres =n�

i=1

(yi−yi )2.

R2 =SSmodelSStotal

R2 ‘vicino’ a 1: il modello prevede molto bene i dati osservati; R2

‘vicino’ a 0: il modello non ha quasi capacita previsionale.Dal punto di vista strettamente statistico si puo solo dire se laregressione e significativa (si rifiuta l’ipotesi β = 0) o no.

Page 11: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 11 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

I pericoli dell’estrapolazione

Page 12: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 12 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Una funzione nonlineare può essere meglio di una retta

Page 13: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 13 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Grafici dei residui: essenziali per valutare la correttezza del modello usato

Page 14: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 14 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Effetto di trasformazioni logaritmiche dei dati

Page 15: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 15 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Page 16: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 16 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Un’appropriata trasformazione dei dati (in questo caso logaritmica) può curare anche l’eterogeneità della varianza

Page 17: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 17 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

L’effetto dell’errore di misura nella regressione

Page 18: Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea Pugliese Created Date 12/5/2011 4:53:03 PM

17 | 18 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010

Si può trovare una funzione che interpoli esattamente tutti i dati osservati, oppure una più semplice (e più sensata) che si limiti ad approssimarli.