Upload
others
View
30
Download
0
Embed Size (px)
Citation preview
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 1
Στατιστική Ανάλυση Δεδομένων II
Γραμμική Παλινδρόμηση με το S.P.S.S.
μέρος Α΄(απλή παλινδρόμηση)
Νίκος Τσάντας Πρόγραμμα Μεταπτυχιακών Σπουδών Τμήμ. Μαθηματικών
“Μαθηματικά και Σύγχρονες Εφαρμογές” Ακαδημαϊκό έτος 2011-12
Μοντέλο: Αναζητάμε το (μαθηματικό) μοντέλο, που περιγράφει, με τον καλύτερο
δυνατό τρόπο, τις τιμές μιας μεταβλητής (εξαρτημένη/προβλεπόμενη) συναρ-
τήσει των τιμών μιας ή περισσότερων άλλων μεταβλητών (ανεξάρτητη/προβλέ-
πουσα).
Γραμμικά μοντέλα πρόβλεψης:
? Εύρεση b0, b1, …, bk
2
0 1 2
k
ky b b x b x b x
Υποθέστε ότι διαπιστώσατε την ύπαρξη (γραμμικής) σχέσης μεταξύ δύο μεταβλητών.
Λογικά, στη συνέχεια θα πρέπει να προχωρήσετε στην περιγραφή αυτής της σχέσης.
Προϋποθέσεις εφαρμογής
κλίμακα μέτρησης τουλάχιστον ordinal
ύπαρξη γραμμικής σχέσης
βλέπε υπόλοιπα
Ευθεία (ελαχίστων τετραγώνων): y = b0 + b1x
b1 →… ερμηνεία
b0 →… ερμηνεία
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 2
A small example. SST uses the differences between the
observed data and the mean value of Y.
SSR uses the differences between the
observed data and the regression line.
SSM uses the differences between the
mean value of Y and the regression line.
A measure of how much the model has improved
the prediction of the outcome compared to the
level of inaccuracy of the model.
The proportion of improvement due to the
model.
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 3
(αρχείο world95.sav)
Is the measure of the education level (literacy rate for females) useful for predicting
life expectancy?
?? εμφάνιση γραμμής παλινδρόμησης
Graphs Scatter/Dot Simple Scatter
Ευθεία (ελαχίστων τετραγώνων):
(female life expectancy) = b0 + b1(female literacy) + ε
Analyze Regression Linear...
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 4
Πόσο καλή είναι η προσαρμογή; (Pearson’s r)
Πόσο ποσοστό της συνολικής μεταβλητότητας εξηγείται; (R2)
Υπάρχει πράγματι μια σχέση ευθείας; (b1 = 0)
Έχουμε στα χέρια μας το σωστό μοντέλο; (δεν ξέρουμε)
χρόνια (<10.72)
(female life expectancy) = 47.17 + 0.307(female literacy)
ΥΠΟΛΟΙΠΟ
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 5
(female life expectancy) = 47.17 + 0.307(female literacy)
ΠΡΟΒΛΕΨΗ. ΠΡΟΣΟΧΗ ΣΤΟ ΕΥΡΟΣ
για (female literacy) = 90 είναι (female life expectancy) = 74.8
The t-statistics provide some clue regarding the relative importance of
(each) variable in the model.
The probabilities should not be used for a formal test regarding the
importance of each variable.
These probabilities are appropriate if you want to do one preselected test
and not if you are looking, say, for the strongest/weakest variable.
As a guide regarding useful predictors, look for t values well below
-2 or above +2.
ΔΙΑΣΤΗΜΑ ΕΜΠΙΣΤΟΣΥΝΗΣ (for the predicted means)
(μέση τιμή δείγματος 67.26)
Graphs Scatter/Dot Simple Scatter
dependent= average female life expectancy independent= females who read
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 6
ΔΙΑΣΤΗΜΑ ΕΜΠΙΣΤΟΣΥΝΗΣ (for individual cases)
(μέση τιμή δείγματος 67.26)
Graphs Scatter/Dot Simple Scatter
dependent= average female life expectancy independent= females who read
LAST, BUT NOT LEAST, CAUTIONS:
Be careful about concluding “if literacy is increased, the population will live
longer”.
There is strong association between “literacy” and “life expectancy”, but
association is not the same as causation.
If an investigator observes the values of the independent and dependent
variables for a set of subjects (cases), association does not establish
causation.
If an investigator does an experiment where he/she sets the values of
the independent variable (for example, six specific doses of a drug) and
watches the effect on the dependent variable, there may be little question
that the results were caused by the independent variable.
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 7
Η αποδοχή του μοντέλου της παλινδρόμησης εξασφαλίζεται από την
αποδοχή ότι θα πρέπει
τα υπόλοιπα να ακολουθούν την κανονική κατανομή,
τα υπόλοιπα να έχουν διακύμανση ίδια για όλες τις τιμές της ανεξάρτητης
μεταβλητής,
διαδοχικά υπόλοιπα να είναι ανεξάρτητα.
(αρχείο world95.sav)
Is the measure of the education level (literacy rate for females) useful
for predicting life expectancy?
(female life expectancy) = 47.17 + 0.307(female literacy)
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 8
(Statistics)
(Plots)
*ZPRED: standardized predicted values
*SDRESID: Studentized deleted residuals
*DEPENDNT
If the distribution of residuals is approximtly
normal, you know that about 95% of the
standardized residuals should be between
-2 and +2.
Of course, even if the model fits well, you
expect to see about 5% of the cases with
standardized residuals greater than 2 in
absolute value.
Checking for Normality
Standardized Residuals
???
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 9
Άλλος τρόπος: στατιστικός έλεγχος
(αφού πρώτα αποθηκευτούν / use
the “save” dialog box)
Checking for Normality
Standardized Residuals
Checking for Constant Variance
Studentized (deleted) Residuals
Ideally, the points should fall in a horizontal
band across the plot, you should see no
systematic trends, and you should be
concerned if gross outliers are identified.
???
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 10
Checking Independence
(Durbin-Watson test)
This statistic ranges in value from 0 to 4. If there is no
correlation between successive residuals, the Durbin
Watson statistic should be close to 2. Values close to 0
indicate that successive residuals are positively correlated,
while values close to 4 indicate strong negative correlation.
Always
check the fitting
If the model fits each data value exactly, the observed and predicted values would
coincide on a straight line extending from the lower left corner to the upper right.
? Zambia. Actually life expectancy for its females is among the lowest in this sample;
yet its predicted value is close to the mean of all predicted values (0.0).
? Botswana.
use the “save” dialog box.
ΤΣΑΝΤΑΣ ΝΙΚΟΣ 19/3/2012
ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 11
Βιβλιογραφία
Andy Field (2009). Discovering statistics using SPSS, 3rd edition. SAGE Publications
M.J. Norusis (2011). IBM SPSS Statistics 19 Guide to Data Analysis. Prentice Hall.