Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea...
Transcript of Michael C. Whitlock • Dolph Schluter ANALISI …pugliese/statdott/regressione.pdfAuthor Andrea...
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
17 | 2 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010
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
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.
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.
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
17 | 7 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010
Il significato dei parametri
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
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
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.
17 | 11 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010
I pericoli dell’estrapolazione
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
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
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
17 | 15 M.C. Whitlock, Dolph Schluter, ANALISI STATISTICA DEI DATI BIOLOGICI, Zanichelli editore S.p.A. Copyright © 2010
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
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
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.