Στατιστική Ανάλυση Δεδομένων II Γραμμική Παλινδρόμηση με το S.P.S.S. μέρος Α (απλή παλινδρόμηση) Νίκος Τσάντας Πρόγραμμα Μεταπτυχιακών Σπουδών Τμήμ. Μαθηματικών Μαθηματικά και Σύγχρονες Εφαρμογές Ακαδημαϊκό έτος 2011-12 Υποθέστε ότι διαπιστώσατε την ύπαρξη (γραμμικής) σχέσης μεταξύ δύο μεταβλητών. Λογικά, στη συνέχεια θα πρέπει να προχωρήσετε στην περιγραφή αυτής της σχέσης. Μοντέλο: Αναζητάμε το (μαθηματικό) μοντέλο, που περιγράφει, με τον καλύτερο δυνατό τρόπο, τις τιμές μιας μεταβλητής (εξαρτημένη/προβλεπόμενη) συναρτήσει των τιμών μιας ή περισσότερων άλλων μεταβλητών (ανεξάρτητη/προβλέπουσα). Γραμμικά μοντέλα πρόβλεψης: 2 k y b0 b1 x b2 x bk x? Εύρεση b 0, b 1,, b k Ευθεία (ελαχίστων τετραγώνων): y = b 0 + b 1 x b 1 ερμηνεία b 0 ερμηνεία Προϋποθέσεις εφαρμογής κλίμακα μέτρησης τουλάχιστον ordinal ύπαρξη γραμμικής σχέσης βλέπε υπόλοιπα ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 1
A small example. SSR uses the differences between the observed data and the regression line. SST uses the differences between the observed data and the mean value of Y. SSM uses the differences between the mean value of Y and the regression line. The proportion of improvement due to the model. A measure of how much the model has improved the prediction of the outcome compared to the level of inaccuracy of the model. ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 2
(αρχείο 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) = b 0 + b 1 (female literacy) + ε Analyze Regression Linear... ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 3
Πόσο καλή είναι η προσαρμογή; (Pearson s r) Πόσο ποσοστό της συνολικής μεταβλητότητας εξηγείται; (R 2 ) Υπάρχει πράγματι μια σχέση ευθείας; (b 1 = 0) Έχουμε στα χέρια μας το σωστό μοντέλο; (δεν ξέρουμε) χρόνια (<10.72) (female life expectancy) = 47.17 + 0.307(female literacy) ΥΠΟΛΟΙΠΟ ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 4
(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 ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 5
ΔΙΑΣΤΗΜΑ ΕΜΠΙΣΤΟΣΥΝΗΣ (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. ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 6
Η αποδοχή του μοντέλου της παλινδρόμησης εξασφαλίζεται από την αποδοχή ότι θα πρέπει τα υπόλοιπα να ακολουθούν την κανονική κατανομή, τα υπόλοιπα να έχουν διακύμανση ίδια για όλες τις τιμές της ανεξάρτητης μεταβλητής, διαδοχικά υπόλοιπα να είναι ανεξάρτητα. (αρχείο 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) ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 7
(Statistics) *ZPRED: standardized predicted values (Plots) *SDRESID: Studentized deleted residuals *DEPENDNT Checking for Normality Standardized Residuals??? 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. ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 8
Checking for Normality Standardized Residuals Άλλος τρόπος: στατιστικός έλεγχος (αφού πρώτα αποθηκευτούν / use the save dialog box) 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. ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 9
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 use the save dialog box. 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. ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 10
Βιβλιογραφία Andy Field (2009). Discovering statistics using SPSS, 3 rd edition. SAGE Publications M.J. Norusis (2011). IBM SPSS Statistics 19 Guide to Data Analysis. Prentice Hall. ΑΠΛΗ ΠΑΛΙΝΔΡΟΜΗΣΗ 11