• Aucun résultat trouvé

A. LA RÉGRESSION LOGISTIQUE BIN

N/A
N/A
Protected

Academic year: 2022

Partager "A. LA RÉGRESSION LOGISTIQUE BIN"

Copied!
33
0
0

Texte intégral

(1)

RÉGRESSIONS LOGISTIQUES MASTER 1

1

PLAN DU COURS Régression logistique binaire simple (chd) Régression logistique binaire multiple - données individuelles (faillite, bébé) - données agrégées (job satisfaction) Régression logistique ordinale (bordeaux) - p entes égales - p artiellement à pentes égales Régression logistique multinomiale (bordeaux, alligator)

A. LA RÉGRESSION LOGISTIQUE BIN

A IRE

3

Les données Y = variable à expliquer binaire X 1 ,…, X k = variables explicatives numériques ou binaires (indicatrices de modalités) • R égression logistique binaire simple (k = 1) • R égression logistique binaire multiple (k > 1)

I. LA RÉGRESSION L OGISTIQUE BIN A IRE SIMPLE V a riable dépendante : Y = 0 ou 1 V a riable indépendante : X quantitative ou binaire Objectif : Modéliser • Le modèle linéaire  (x) =  0 +  1 x convient mal lorsque X est continue.

 (x) = Prob(Y = 1/X = x) • Le modèle logistique est plus naturel.

(2)

5

Ex emple : Age and Cor onar y Hear t D isease Sta tus (CHD) Les données

IDAGRPAGECHD 1 2 3 4 5

97 98 99 100

1 1 1 1 1

8 8 8 8

20 23 24 25 25

64 64 65 69

0 0 0 0 1

0 1 1 1

Plot of CHD by Age

AGE

70605040302010

CHD

1.2 1.0 .8 .6 .4 .2 0.0 -.2

DESCRIPTION DES DONNÉES REGR OUPÉES PAR CLASSE D'A G E

7

Age GroupnCHD absentCHD presentMean (Proportion) 20 – 29 30 – 34 35 – 39 40 – 44 45 – 49 50 –54 55 - 59 60 - 69

10 15 12 15 13 8 17 10

9 13 9 10 7 3 4 2

1 2 3 5 6 5 13 8

0.10 0.13 0.25 0.33 0.46 0.63 0.76 0.80 Total10057430.43

Ta bleau des ef fectifs de CHD par classe d'âge Graphique des proportions de CHD par classe d'âge

AGEGRP

87654321

Proportion (CHD)

1.0 .8 .6 .4 .2 0.0

LE MODÈLE LOGISTIQUE

x x 1 0 1 0 e 1 e ) x(        x x

x Log 1 0 ) ( 1 ) (     

  

 

 

ou

Probabilité d'une maladie cardiaque en fonction de l'age

AGE

605040302010

Prob(Y=1 / X)

1.0 .8 .6 .4 .2 0.0

Fonction de lien : Logit

(3)

9

FONCTIONS DE LIEN • F onction logit g(p) = log(p / (1 - p)) • F onction normit ou probit g(p) =  -1 (p) où  est la fonction de répartiti on de la loi normale réduite • F onction « complementary log-log » g(p) = log(-log(1-p))

ESTIMA TION DES P ARAMÈTRES DU MODÈLE L OGISTIQUE Les données XY x

1

x

i

x

n

y

1

y

i

y

n

y i = 1 si caractère présent, 0 sinon

i 1 0

i 1 0 x

x i i e 1 e

) x X/ 1 Y( P ) x(      

   

Le modèle

VRAISEMBLANCE DES DONNÉES Probabilité d’observer les données [(x ,y ), …, (x ,y ), …, (x ,y )]

11iinn

11

     n 1 i i i ) x X/ y Y( Prob  

     n 1 i

y 1 i y i i i )) x( 1( ) x( 01 (, )   

01 0101

1 1 1 () () 11

i ii ii

x n yy xx i

e ee

  

      

LOG-VRAISEMBLANCE 1 01 01 1 1 01 01 1

(, ) ( (, )) [ ( ) (1 ( ) () ( ) (1 ( )) 1( ) ( ) (1 ex p( ))

ii

n yy ii i n i ii i i n ii i i

LL o g L o g x x x yL o g L o g x x yx L o g x

  

                    

  

(4)

ESTIMA TION DU MAXIMUM DE VRAISEMBLANCE On cherche maximisant la Log-vraisemblance . La matrice est estimée par la matrice

13

1 0 ˆ et ˆ   01

ˆˆ (,

) L  

 

 

         )

ˆ ( V )

ˆ , ˆ (

Cov )

ˆ , ˆ (

Cov )

ˆ ( V )ˆ ( V 1 1 0

1 0 0

12 ˆ

() '

L

 

  

 

   



 

RÉSUL TA T S

Model Summary

107.353 .254 .341 Step 1

-2 Log likelihood Cox & Snell R Square Nagelkerke R Square

Variables in the Equation .111.02421.2541.0001.117 -5.3091.13421.9351.000.005

AGE Constant

Step 1a

BS.E.WalddfSig.Exp(B) Variable(s) entered on step 1: AGE.a.

Omnibus Tests of Model Coefficients 29.310 1 .000 Model Step 1 Chi-square df Sig.

T est LR T pour H 0 : 1 = 0 RÉSUL TA T S

15

Estimated Covariance Matrix Variable Intercept age Intercept 1.285173 -0.02668 age -0.02668 0.000579

Ecart-type de la constante = 1.285173 1/2 = 1.134 Ecart-type de la pente = .000579 1/2 = .024 Covariance entr e la constante et la pente = -.02668

TEST DE WALD Le modèle x

x

1010

e 1 e ) x X/ 1 Y( P ) x(           Te st H 0 :  1 = 0 H 1 :  1  0 Statistique utilisée

2 1 2 1

ˆ Wal d s   Décision de rejeter H 0 au risque  Rejet de H 0 si W ald )1(

2 1 2   ou NS = P(  (1)  Wa ld )  

(5)

TEST LR T

17

Le modèle x

x

1010

e 1 e ) x X/ 1 Y( P ) x(           Te st H 0 :  1 = 0 H 1 :  1  0 Statistique utilisée    -2 ( ) - -2 ( , ) LC st e L C st e X  Décision de rejeter H 0 au risque  Rejet de H 0 si  )1(

2 1 2   ou NS = P(  (1)  )  

INTER V A LLE DE CONFIANCE DE (X) AU N IV E AU 9 5% De 2 01 0 1 0 1 ˆˆ ˆ ˆ ˆ ˆ Var ( ) V ar ( ) Var ( ) 2 C ov ( , ) xx x          on déduit l’intervalle de confiance de

01 01

x x e (x) 1e

     

01010101 01010101

ˆˆ ˆˆ ˆˆ ˆˆ x 1.96 V ar ( x ) x 1.96 Va r( x ) ˆˆ ˆˆ ˆˆ ˆˆ x1 .9 6 V ar ( x ) x 1. 96 V ar ( x ) ee ; 1e 1e

                             INTER V A LLE DE CONFIANCE DE (X) AU N IV E AU 9 5%

19

Case Summariesa 20.0.04.01.14 23.0.06.02.17 24.0.07.02.18 25.0.07.03.19 25.0.07.03.19 26.0.08.03.20 26.0.08.03.20 28.0.10.04.23 28.0.10.04.23 29.0.11.05.24 30.0.12.05.25 30.0.12.05.25 30.0.12.05.25 30.0.12.05.25 30.0.12.05.25 30.0.12.05.25 32.0.15.07.28 32.0.15.07.28 33.0.16.08.29 33.0.16.08.29 34.0.18.09.31 34.0.18.09.31 34.0.18.09.31 34.0.18.09.31 34.0.18.09.31 35.0.19.11.33 35.0.19.11.33 36.0.21.12.34 36.0.21.12.34 36.0.21.12.34 30303030

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 NTotal

AGEPROBABILITE CALCULEINF95SUP95 Limited to first 30 cases.a.

INTER V A LLE DE CONFIANCE DE (X) A U NIVEA U 95%

706050403020

1.0 .8 .6 .4 .2 0.0

SUP95 INF95 PROBABILITE

(6)

21

Compar aison entr e les pr opor tions obser vées et théoriques Proportion observée : 

ClasseiClassei

n y / Proportion théorique : 

ClasseiClassei

n / ˆ  puisque E(y

i

) = 

i

estimé par i ˆ

Report .1000.0787086 1010 .1333.1484562 1515 .2500.2299070 1212 .3333.3519639 1515 .4615.4824845 1313 .6250.6087623 88 .7647.7302152 1717 .8000.8391673 1010 .4300.4300000 100100

Mean N Mean N Mean N Mean N Mean N Mean N Mean N Mean N Mean N

AGEGRP 1 2 3 4 5 6 7 8 Total

Maladie cardiaquePredicted probability

Classe d'age

87654321

Proportion

1.0 .8 .6 .4 .2 0.0

Prop. observée Prop. théorique

Compar aison entr e les pr opor tions obser vées et théoriques TEST DE HOSMER & LEMESHO W (GOODNESS OF FIT TEST) Les données sont rangées par ordre croissant des probabilités calculées à l’aide du modèle, puis partagées en 10 groupes au plus. Ce test est malheureusement peu puissant .

23

Groupe

10987654321

Effectif

12 10 8 6 4 2 0

Théorique Observé

Le test du khi-deux est utilisé pour comparer les ef fectifs observés ( ) aux ef fectifs théoriques ( ). Nb de degrés de liberté = Nb de groupes - 2

Classei

i

y 

Classeii

ˆ

TEST DE HOSMER & LEMESHO W

Contingency Table for Hosmer and Lemeshow Test 99.2131.78710 98.65711.34310 88.09521.90510 88.03732.96311 76.94744.05311 55.32254.67810 54.20055.80010 33.736109.26413 22.13487.86610 1.66144.3395

1 2 3 4 5 6 7 8 9 10

Step 1

ObservedExpected

Maladie cardiaque = chd=no ObservedExpected

Maladie cardiaque = chd=yes Total

Hosmer and Lemeshow Test .890 8 .999 Step 1 Chi-square df Sig.

(7)

MESURE DE LA QU ALITÉ DE LA MODÉLISA TION R 2 de Cox & Snell R 2 ajusté de Nagelkerke

25

2 2

() 1[ ] (, )

n

ct e R ct e X   

2 max

2

2 adj

R R R 

2 2

1[ ( )]

n

M ax R cte  

Pseudo R2 (McFadden)

2

2( , ) 1[ ] 2( )

L ct e X Pseudo R L ct e    

TABLEA U DE CLASSIFICA TION Une observation i est affectée à la classe [Y=1] sic . T a bleau de classification ( c = 0.5 ) Sensibilité = 29/43 Spécificité = 45/57 taux de faux positifs = 12/41 taux de faux négatifs = 14/59

i ˆ  TABLE OF CHD BY PREDICTS CHD PREDICTS Frequency‚ 0‚ 1‚ Total ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ 0 ‚ 45 ‚ 12 ‚ 57 ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ 1 ‚ 14 ‚ 29 ‚ 43 ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ Total 59 41 100 OBJECTIFS Sensibilité = capacité à diagnostiquer les malades parmi les malades Spécificité = capacité à reconnaître les non- malades parmi les non-malades 1 - S pécificité = risque de diagnostiquer un malade chez les non-malades.

27

T rouver un compr o mis acceptable entr e forte sensibilité et forte spécificité.

GRAPHIQUE R O C (RECEIVER OPERA T ING CHARA CTERISTIC) Sensibilité : capacité à prédire un évènement Spécificité : capacité à prédire un non- événement Graphique ROC : y = Sensibilité( c ) x = 1 - S pécificité ( c )

Coronary Hearth Disease ROC curve

1 - Spécificité

.8.6.4.20.0

Sensitivité

1.0 .8 .6 .4 .2 0.0

C= 0.5

L ’air e sous la courbe ROC est une mesur e du pouvoir prédictif de la variable X. Ici cette surface est égale à 0.8.

(8)

COEFFICIENTS D ’ASSOCIA T ION ENTRE LES PR OB ABILITÉS CAL CULÉES ET LES RÉPONSES OBSER VÉES N = effectif total t = nombre de paires avec des réponses différentes = nb(0)*nb(1) nc = nombre de paires concordantes (y

i

< y

j

et ) nd = nombre de paires discordantes (y

i

< y

j

et ) t - n c - nd = Nb d’ex-aequo (y

i

< y

j

et ) D de Somer = (nc - nd) / t Gamma = (nc - nd) / (nc + nd) T a u-a = (nc - nd) / (.5N(N-1)) c = (nc + .5(t - n c - nd)) / t c = aire sous la courbe ROC

29

j i ˆ ˆ    j i ˆ ˆ    ij ˆˆ  

Anal yse des résidus données individuelles Résidu de Pearson (Standardized Residual) ) ˆ 1( ˆ ˆ y r i i

i i i       à comparer à 2 en valeur absolue

31

Autres statistiques pour l’analyse des résidus Influence de chaque observation sur la déviance (DifDev)  i D = D(toutes les obs.) - D (toutes les obs. sauf l’obs. i)

Résidu déviance (Deviance) ] x X/ y Y[ Prob log( 2 ) ˆ y( signe d i i estimée i i i       à comparer à 2 en valeur absolue

Déviance : 2 2l og i D d     Studentized r esidual : i i i D ) ˆ y( signe   

AN AL Y SE DES RÉSIDUS

100100100N = Deviance valueStudentized residualStandardized residual

4 3 2 1 0 -1 -2 -3

16

5

(9)

II. LA RÉGRESSION LOGISTIQUE MUL T IPLE EXEMPLE : PRÉVISION DE FA ILLITE

33

Les données

Les ratios suivants sont observés sur 46 entreprises : Deux ans après 21 de ces entrep rises ont fait faillite et 25 sont restées en bonne santé financière.

- X 1 = F lux d e tr és or er ie / D ett e to ta le - X 2 = R esul ta t n et / A ct if - X 3 = A ctif à c our t te rm e / D ett e à c our t te rm e - X 4 = A ctif à c our t te rm e / V en te s - Y = F s i f aill it e, N F s ino n

LES DONNÉES DES ENTREPRISES

Case Summariesa -.45-.411.09.45F -.56-.311.51.16F .06.021.01.40F -.07-.091.45.26F -.10-.091.56.67F -.14-.07.71.28F .04.011.50.71F -.07-.061.37.40F .07-.011.37.34F -.14-.141.42.43F -.23-.30.33.18F .07.021.31.25F .01.002.15.70F -.28-.231.19.66F .15.051.88.27F .37.111.99.38F -.08-.081.51.42F .05.031.68.95F .01.001.26.60F .12.111.14.17F -.28-.271.27.51F .51.102.49.54NF .08.022.01.53NF .38.113.27.35NF .19.052.25.33NF .32.074.24.63NF .31.054.45.69NF .12.052.52.69NF -.02.022.05.35NF .22.082.35.40NF .17.071.80.52NF .15.052.17.55NF -.10-.012.50.58NF .14-.03.46.26NF .14.072.61.52NF .15.062.23.56NF .16.052.31.20NF .29.061.84.38NF .54.112.33.48NF -.33-.093.01.47NF .48.091.24.18NF .56.114.29.44NF .20.081.99.30NF .47.142.92.45NF .17.042.45.14NF .58.045.06.13NF

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

cash flow / total debtnet income / total assets current assets / current liabilities

current assets / net salesFAILLITE Limited to first 100 cases.a.

35

2125N = FAILLITE

FailliteNon faillite

Flux de tr ésor erie / D ette totale

.8 .6 .4 .2 0.0 -.2 -.4 -.6 -.8

2

40 2125N = FAILLITE

FailliteNon faillite

Résultat net / Actif

.2 .1 0.0 -.1 -.2 -.3 -.4 -.5

1

34 40 2125N = FAILLITE

FailliteNon faillite

Actif à court terme / D ette à court terme

6 5 4 3 2 1 0

6 11

13 34

264227

46 2125N = FAILLITE

FailliteNon faillite

Actif à court terme / Ventes

1.2 1.0 .8 .6 .4 .2 0.0

Boîtes à moustaches des ratios financiers selon le critère de Faillite Intervalle de confiance des moyennes des ratios financiers selon le critère de Faillite

2125N = FAILLITE

OuiNon

95%

CI X1

.4 .3 .2 .1 0.0 -.1 -.22125N = FAILLITE

OuiNon

95%

CI X2

.1 0.0 -.1 -.2 2125N = FAILLITE

OuiNon

95% C

I X

3

3.5 3.0 2.5 2.0 1.5 1.02125N = FAILLITE

OuiNon

95% C

I X

4

.6 .5 .4 .3

(10)

RÉGRESSIONS L OGISTIQUES

SIMPLES DE Y SUR LES RA

TIOS X

37

V a ri abl e C o eff ici ent

1

ˆ  WA L D NS R

2

de Nagelker k e X

1

- 7. 526 9. 824 .0 02 .4 66 X

2

- 19. 493 8. 539 .0 03 .4 66 X

3

- 3. 382 11. 75 .0 01 .6 11 X

4

.3 54 .0 40 .8 41 .0 01 NS < .05 Prédicteur significatif

Le modèle de la rég ression logistique Le modèle

01144 01144

x ... x x ... x e (x) P (Y F /X x) 1e

            

VRAISEMBLANCE DES DONNÉES Probabilité d’observer les données [(x ,y ), …, (x ,y ), …, (x ,y )]

11iinn

39

     n 1 i i i ) x X/ y Y( Prob  

     n 1 i

y 1 i y i i i )) x( 1( ) x( 01 4 ( , ,. .., )    

0jj0jj jj ii 0jj0jj jj

xx n y 1 y xx i1 ee () (1 ) 1e 1e

           

    

RÉSUL TA T S C o llin e a ri ty S ta tis ti c s To le ra n c e V IF X 1 0. 212 4. 725 X 2 0. 252 3. 973 X 3 0. 635 1. 575 X 4 0. 904 1. 106

Model Summary 27.443.543.725Step 1

-2 Log likelihoodCox & Snell R SquareNagelkerke R Square Variables in the Equation

-7.138 6.002 1.414 1 .234 .001 3.703 13.670 .073 1 .786 40.581 -3.415 1.204 8.049 1 .005 .033 2.968 3.065 .938 1 .333 19.461 5.320 2.366 5.053 1 .025 204.283

X1 X2 X3 X4 Constant

Step 1

a

B S.E. Wald df Sig. Exp(B) Variable(s) entered on step 1: X1, X2, X3, X4. a.

(11)

RÉSUL TA T S

41

Correlations

1 .858** .571** -.053 . .000 .000 .725 46 46 46 46 .858** 1 .471** .055 .000 . .001 .717 46 46 46 46 .571** .471** 1 .154 .000 .001 . .306 46 46 46 46 -.053 .055 .154 1 .725 .717 .306 . 46 46 46 46

Pearson Correlation Sig. (2-tailed) N Pearson Correlation Sig. (2-tailed) N Pearson Correlation Sig. (2-tailed) N Pearson Correlation Sig. (2-tailed) N

X1 X2 X3 X4

X1 X2 X3 X4 Correlation is significant at the 0.01 level (2-tailed). **.

Le modèle estimé

1234 1234

5.320 7.138 X 3.703 X 3.415 X 2.968 X 5.320 7.138 X 3.703 X 3.415 X 2.968 X

Pr ob (Y F /X ) e 1e

           

   Prévision de faillite

Classification Tablea 24196.0 31885.7 91.3

Observed NF F

SITUATION Overall Percentage

NFF

FAILLITEPercentage Correct

Predicted The cut value is .500a.

TEST DE HOSMER & LEMESHO W

43

Hosmer and Lemeshow Test 5.2017.636Step 1Chi-squaredfSig. Contingency Table for Hosmer and Lemeshow Test 54.9990.0015 54.9060.0945 44.6131.3875 54.1430.8575 43.47311.5275 11.76243.2385 0.66754.3335 1.34044.6605 0.09865.9026

1 2 3 4 5 6 7 8 9

Step 1

ObservedExpectedFAILLITE = Non ObservedExpectedFAILLITE = Oui Total

RÉGRESSION L OGISTIQUE P A S À PA S DESCEND A NTE Sans X 2

Model Summary

27.516 .542 .724 Step 1

-2 Log likelihood Cox & Snell R Square Nagelkerke R Square

Variables in the Equation -5.7723.0053.6901.055.003 -3.2891.0859.1831.002.037 2.9793.025.9701.32519.675 5.0382.0605.9831.014154.193

X1 X3 X4 Constant

Step 1a

BS.E.WalddfSig.Exp(B) Variable(s) entered on step 1: X1, X3, X4.a.

(12)

RÉGRESSION L OGISTIQUE P A S À PA S DESCEND A NTE

45

Sans X 4

Model Summary

28.636 .531 .709 Step 1

-2 Log likelihood Cox & Snell R Square Nagelkerke R Square

Variables in the Equation -6.5562.9055.0921.024.001 -3.0191.0029.0771.003.049 5.9401.9868.9501.003379.996

X1 X3 Constant

Step 1a

BS.E.WalddfSig.Exp(B) Variable(s) entered on step 1: X1, X3.a.

CAR TE DES ENTREPRISES D A NS LE PLAN (X 1 , X 3 ) cash flow / total debt

.6.4.2-.0-.2-.4-.6

current assets / current liabilities

6 5 4 3 2 1 0

FAILLITE

F NF

46 45

44 43

42 41

40 39 38

3736

35 34

33 32 31

30 29

28

27 26 25

24 23

22 21 2019

18 17

1615 14

13 12 11

10987 6

54 3

2 1

ÉQU A TION DE LA DR OITE FR ONTIÈRE

47

13 12

5.940 6.556 X 3.019 X 5.940 6.556 X 3.019 X e P rob (Y F /X ) 0.5 1e

         X 3 = (5.940 - 6.556  X 1 )/3.019

5.940 - 6.556  X 1 - 3.019  X 3 = 0

Carte des entr eprises dans le plan (x 1 , x 3 ) avec la dr oite fr ontièr e issue de la régr ession logistique cash flow / total debt

.6.4.2-.0-.2-.4-.6

current assets / current liabilities

6 5 4 3 2 1 0

46 42 3922 4144

24 16

2627 38

30 4325 31

45 37

36 32 15 34

35 2028 23 9 12 3

18 7 19

1329 8417

33 5 10 6 11

1421

40 1

2

X

3

= (5.940 - 6 .556X

1

)/3.019 Dr oite d’iso-pr obabilité 0.5

(13)

EXEMPLE II : L O W B IR TH WEIGHT B ABY (HOSMER & LEMESHO W ) Y = 1 si le poids du bébé < 2 500 grammes, = 0 sinon n 1 = 59, n 0 = 130 Facteurs de risque : -A g e - L WT (Last Menstrual Period W eight) - R ace (White, Black, Other) - F TV (Nb o f First T rimester Physician V isits) - S moke (1 = YES, 0 = NO)

49

Résultats

Model Summary 214.575.101.142Step 1

-2 Log likelihoodCox & Snell R SquareNagelkerke R Square Variables in the Equation -.022.035.4101.522.978 -.012.0063.7621.052.988 -.941.4185.0701.024.390 .289.527.3011.5831.336 -.008.164.0021.962.992 1.053.3817.6371.0062.866 1.2691.0231.5391.2153.558

AGE LWT WHITE BLACK FTV SMOKE Constant

Step 1a

BS.E.WalddfSig.Exp(B) Variable(s) entered on step 1: AGE, LWT, WHITE, BLACK, FTV, SMOKE.a. Coefficientsa .8841.132 .8691.150 .8651.156 .9391.065 .6861.457 .7431.346

AGE weight last menstrual period smoking during pregnancy n° physician visits first trimester WHITE BLACK

Model 1ToleranceVIF

Collinearity Statistics Dependent Variable: low birth weighta.

Aucun pr oblème de multicolinéarité

51

V alidité du modèle Te st de Hosmer et Lemeshow Hosmer and Lemeshow Test 11.825 8 .159 Step 1 Chi-square df Sig.

Contingency Table for Hosmer and Lemeshow Test 1917.27801.72219 1716.41122.58919 1415.45453.54619 1213.95575.04519 1613.04135.95919 1212.59976.40119 912.084106.91619 911.569107.43119 1310.71568.28519 96.888911.11218

1 2 3 4 5 6 7 8 9 10

Step 1

ObservedExpected

low birth weight = weight > 2500 g ObservedExpected low birth weight = weight < 2500 g Total

ODDS-RA T IO Pour un événement rare l’odds-ratio est peu différent du risque relatif défini par :

Smoke

O dds Ra tio (Sm oke ) P rob (Y 1 /X ,S m oke ye s) /P rob (Y 0 /X ,S m oke ye s) Pr ob (Y 1 /X ,Sm ok e no )/ Pr ob (Y 0 /X ,Sm ok e no ) ex p( )

         Pr ob (Y 1 /X ,Sm ok e ye s) Risque Re la tif Pr ob (Y 1 /X ,Sm ok e no )    

(14)

INTER V A LLE DE CONFIANCE DE L’ ODDS-RA T IO A U NIVEA U 95%

53

2 S m oke S m oke ˆ Va r( ) s  De on déduit l’intervalle de confiance de OR(Smoke) : S m oke S m oke S m oke S m oke ˆˆ 1.96 s 1.96 s [e , e ]  

INTER V A LLE DE CONFIANCE DE L’ ODDS-RA T IO A U NIVEA U 95%

Variables in the Equation

-.022 .978 .914 1.047 -.012 .988 .975 1.000 -.941 .390 .172 .885 .289 1.336 .475 3.755 -.008 .992 .719 1.369 1.053 2.866 1.358 6.046 1.269 3.558

AGE LWT WHITE BLACK FTV SMOKE Constant

Step 1

a

B Exp(B) Lower Upper

95.0% C.I.for EXP(B) Variable(s) entered on step 1: AGE, LWT, WHITE, BLACK, FTV, SMOKE.

a. INFL UENCE D’UN GR OUPE DE V ARIABLES

55

Le modèle k k 1 1 0

k k 1 1 0 x ... x

x ... x e 1 e ) x X/ 1 Y( P ) x(               Te st H 0 :  r+1 = … =  k = 0 H 1 : au moins un  j  0 Statistiques utilisées 1.  = [-2L(Modèle simplifié)] - [-2L(Modèle complet)] 2.                                     

   k1r

1 k1r k1r

ˆ ˆ ˆ ˆ Var ) ˆ ,...,

ˆ (

Wald  

- P roc GENMOD (type 3) - R égression backwardLR avec Removal = 1 dans SPSS - P roc Logistic - P roc Genmod (type 3 et wald) - SPSS

RÈGLE DE DÉCISION On rejette H 0 : r+1 = … = k = 0 au risque de se tromper siou W a ld ou si NS = Prob( 

 r k

2 1

      ) ou Wald r k 2    

(15)

TEST DU F A CTEUR RA CE (WALD)

57

Variables in the Equation -.022.035.4101.522.978 -.012.0063.7621.052.988 7.7842.020 -.941.4185.0701.024.390 .289.527.3011.5831.336 1.053.3817.6371.0062.866 -.008.164.0021.962.992 1.2691.0231.5391.2153.558

AGE LWT RACE RACE(1) RACE(2) SMOKE FTV Constant

Step 1a

BS.E.WalddfSig.Exp(B) Variable(s) entered on step 1: AGE, LWT, RACE, SMOKE, FTV.a.

Modèle sans le facteur Race :

Model Summary

222.815 .061 .086 Step 1

-2 Log likelihood Cox & Snell R Square Nagelkerke R Square

TEST DU F A CTEUR RA CE (LR T )

Likelihood Ratio Tests

214.575

a

.000 0 . 214.990 .415 1 .520 218.746 4.171 1 .041 222.573 7.998 1 .005 214.577 .002 1 .963 222.815 8.239 2 .016

Effect Intercept AGE LWT SMOKE FTV RACE

-2 Log Likelihood of Reduced Model Chi-Square df Sig. The chi-square statistic is the difference in -2 log-likelihoods between the final model and a reduced model. The reduced model is formed by omitting an effect from the final model. The null hypothesis is that all parameters of that effect are 0. This reduced model is equivalent to the final model because omitting the effect does not increase the degrees of freedom.

a.

59

Te st de l’hypothèse linéair e génér ale Le modèle k k 1 1 0

k k 1 1 0 x ... x

x ... x e 1 e ) x X/ 1 Y( P ) x(               Te st H 0 : C(  0 ,  1 , …  k )  =0 H 1 : C(  0 ,  1 , …  k )  0 Statistiques utilisées 1.  = [-2L(H 0 )] - [-2L(H 1 )] 2.

1 00 01

ˆˆ ˆˆ ˆ W al d ( , ,..., ) ' ( ) ' ˆˆ

k kk

CC V a r C C

                      



Proc GENMOD Proc Logistic Proc Genmod

Règ le de décision On rejette H 0 : C(  0 ,  1 , … ,  k )  = 0 au risque  de se tromper si  ou W ald ou si NS = Prob( 

  ) L( rang

2 1    2   ) ou Wald ) L( rang   

(16)

61

La rég

ression logistique pas-à- pas descendante

• O n part du modèle complet. • A chaque étape, on enlève la variable ayant le W ald le moins significatif (plus fort niveau de signification) à condition que son niveau de signification soit supérieur à 10 % .

Modèle Te st H 0 :  j = 0 vs H 1 :  j  0 Statistique suit une loi du khi-deux à 1 degré de liberté sous H 0 .

Te st du Scor e pour la varia ble X j j j t t 1 1 0

j j t t 1 1 0 x x x

x x x e 1 e )x / 1 Y( Prob              

000

1'2 2 2 ˆˆˆ

LL L

HHH

Score

 

     

 

        L   est calculé sur le modèle à t+1 variables.

63

Te st du Scor e pour les varia bles hor s modèle Modèle Te st H 0 :  t+1 =…=  k = 0 vs H 1 : au moins un  j  0 Statistique suit une loi du khi-deux à k-t degré de liberté sous H 0 .

k k 1 t 1 t t t 1 1 0

k k 1 t 1 t t t 1 1 0 x ... x x x

x ... x x x e 1 e ) x/ 1 Y( Prob                      

000

1'2 2 ˆˆˆ

LL L '

HHH

Score

 

     

 

         L   est calculé sur le modèle à k variables.

RÉGRESSION L OGISTIQUE MUL T IPLE (DONNÉES A G RÉGÉES) Exemple : Job satisfaction (Models for discrete data, D. Zelterman, Oxford Science Publication, 1999) 9949 employees in the ‘ c raft job (travail manuel) within a company Response : Satisfied/Dissatisfied Factors : S ex (1=F , 0=M) Race (White=1, Nonwhite=0) Age (<35, 35-44, >44) Region (Northeast, Mid-Atlantic, Southern, Midwest, Northwest, Southwest, Pacific) Explain Job satisfaction with all the main effects and the interactions.

(17)

65

J o b satisf a ct ion (Y /N ) by sex (M /F), race, ag e, a nd region of re sidenc e for em plo y ee s o f a l a rg e U. S. cor p or at io n

WhiteNonwhite Under 3535-44Over 44Under 3535-44Over 44 RegionMFMFMFMFMFMF Northeast Y N Mid-Atlantic Y N Southern Y N Midwest Y N Northwest Y N Southwest Y N Pacific Y N

288 177 90 45 226 128 285 179 270 180 252 126 119 58

60 57 19 12 88 57 110 93 176 151 97 61 62 33

224 166 96 42 189 117 225 141 215 108 162 72 66 20

35 19 12 5 44 34 53 24 80 40 47 27 20 10

337 172 124 39 156 73 324 140 269 136 199 93 67 21

70 30 17 2 70 25 60 47 110 40 62 24 25 10

38 33 18 6 45 31 40 25 36 20 69 27 45 16

19 35 13 7 47 35 66 56 25 16 45 36 22 15

32 11 7 2 18 3 19 11 9 7 14 7 15 10

22 20 0 3 13 7 25 19 11 5 8 4 10 8

21 8 9 2 11 2 22 2 16 3 14 5 8 6

15 10 1 1 9 2 11 12 4 5 2 0 6 2

UTILISA T ION DE LA PR OC LOGISTIC data job; input sat nsat race age sex region; label sat = 'satisfied with job' nsat = 'dissatisfied' race = '0=non-white, 1=white' age = '3 age groups' sex = '0=M, 1=F' region = '7 regions' total = 'denominator' ; total = sat+nsat; propsat = sat/total; cards ; 288 177 1 0 0 0 90 45 1 0 0 1 226 128 1 0 0 2

. . .

2 0 0 2 1 5 6 2 0 2 1 6 ; UTILISA T ION DE LA PR OC LOGISTIC

67

proc l ogistic data =job; class race age sex region/ param =effect; model sat/total = race age sex region race*age race*sex race*region age*sex age*region sex*region / selection = forward hierarchy = none ; run ;

RÉSUL TA T DE LA PR OC LOGISTIC (OPTION FORWARD ET HIERAR CHY =NONE) Type III Analysis of Effects Wald Effect DF Chi-Square Pr > ChiSq race 1 0.1007 0.7510 age 2 50.7100 <.0001 sex 1 14.0597 0.0002 region 6 37.7010 <.0001 race*sex 1 7.5641 0.0060 age*sex 2 5.9577 0.0509

(18)

UTILISA T ION DE LA PR OC LOGISTIC A V EC L ’OPTION P ARAM=EFFECT

69

Analysis of Maximum Likelihood Estimates Standard Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 0.6481 0.0346 350.2297 <.0001 race 0 1 -0.0099 0.0312 0.1007 0.7510 age 0 1 -0.1952 0.0316 38.2459 <.0001 age 1 1 -0.0227 0.0375 0.3675 0.5444 sex 0 1 0.1230 0.0328 14.0597 0.0002 region 0 1 -0.2192 0.0469 21.8470 <.0001 region 1 1 0.2228 0.0820 7.3832 0.0066 region 2 1 -0.0446 0.0527 0.7159 0.3975 region 3 1 -0.1291 0.0462 7.8133 0.0052 region 4 1 -0.0927 0.0472 3.8616 0.0494 region 5 1 0.0704 0.0531 1.7565 0.1851 race*sex 0 0 1 0.0856 0.0311 7.5641 0.0060 age*sex 0 0 1 0.0768 0.0315 5.9428 0.0148 age*sex 1 0 1 -0.0342 0.0375 0.8352 0.3608

CAL CUL ET TEST DES DERNIERS COEFFICIENTS proc l ogistic data =job; class race age sex region/ param =effect; model sat/total = race age sex region race*sex age*sex ; contrast 'Age >44' age - 1 - 1 / estimate = parm; contrast 'Pacific' region - 1 - 1 - 1 - 1 - 1 - 1 estimate =parm; contrast 'Age>44,Homme' age*sex - 1 - 1 / estimate =parm; run ; RÉSUL TA T S

71

Contrast Rows Estimation and Testing Results Standard Wald Contrast Estimate Error Chi-Square Pr > ChiSq Age >44 0.2180 0.0375 0.1444 <.0001 Pacific 0.1924 0.0751 0.0453 0.0104 Age>44,Homme -0.0425 0.0375 -0.1159 0.2565

UTILISA T ION DE LA PR OC LOGISTIC A V EC L ’OPTION P ARAM=EFFECT Femme Homme .05 05. .03 03. .08- 08. 44 44 35 35 Femme Homme 09. 09. 09.- 09. Blanc Blanc Non

Pacific Southwest Northwest Midwest Southern Atlantic Mid Northeast 12. .12 Femme Homme 22. .02 .20 44 44 35 35 01. .01 Blanc Blanc Non .650

)) (Satisfait Logit(Prob                                    

         

         

 

 

       

    

       

 

 

    

(19)

73

Construction d ’un modèle hiérar chique proc l ogistic data =job; class race age sex region/ param =effect; model sat/total= sex region race(sex) age(sex) / scale =none ; contrast 'Pacific' region - 1 - 1 - 1 - 1 - 1 - 1 / estimate =parm; contrast 'Age>44,Homme' age(sex) - 1 - 100 / estimate = parm; contrast 'Age>44,Femme' age(sex) 00 - 1 - 1 / estimate =parm; run ;

RÉSUL TA T S Type III Analysis of Effects Wald Effect DF Chi-Square Pr > ChiSq sex 1 14.0597 0.0002 region 6 37.7010 <.0001 race(sex) 2 7.5710 0.0227 age(sex) 4 55.4078 <.0001

RÉSUL TA T S

75

Analysis of Maximum Likelihood Estimates Standard Parameter DF Estimate Error Chi-Squ are Pr > ChiSq Intercept 1 0.6481 0.0346 350.2297 <.0001 sex 0 1 0.1230 0.0328 14.0597 0.0002 region 0 1 -0.2192 0.0469 21.8470 <.0001 region 1 1 0.2228 0.0820 7.3832 0.0066 region 2 1 -0.0446 0.0527 0. 7159 0.3975 region 3 1 -0.1291 0.0462 7. 8133 0.0052 region 4 1 -0.0927 0.0472 3. 8616 0.0494 region 5 1 0.0704 0.0531 1.7565 0.1851 race(sex) 0 0 1 0.0757 0.0422 3.2230 0.0726 race(sex) 0 1 1 -0.0956 0.0459 4.3244 0.0376 age(sex) 0 0 1 -0.1185 0.0342 11.9881 0.0005 age(sex) 1 0 1 -0.0570 0.0370 2.3683 0.1238 age(sex) 0 1 1 -0.2720 0.0530 26.3735 <.0001 age(sex) 1 1 1 0.0115 0.0652 0.0313 0.8596 Standard Wald Contrast Estimate Error Chi-Square Pr > ChiSq Pacific 0.1924 0. 0751 6. 5729 0.0104 Age>44,Homme 0.17 54 0.0367 22.8477 <.0001 Age>44,Femme 0.26 05 0.0654 15.8719 <.0001

Utilisation de la Pr oc Logistic avec l ’option Param=effect ns ns Blanc Non-blanc 10. 10. 08. - 08. Femme Homme

19. .07 .09 .13 .04 22. .22 Pacific Southwest Northwest Midwest Southern Atlantic Mid Northeast 12. .12 Femme Homme .650

)) (Satisfait Logit(Prob               

         

          

         

 

 

   

Différ ence entr e races par sexe : Race(Sexe)

Différ ence entr e les ages par sexe : Age(Sexe)

35 3 5 44 44

Ho m m e .1 2 .0 6 .18 Fe m m e .27 .01 .26  



  

 

ns ns

(20)

77

Analyse des résidus données agrégées en s groupes •n i = ef fectif du groupe i, i = 1 à s = 84 •y i = nombre de succès observé dans le groupe i • = probabilité de succès dans le groupe i • = = nombre de succès attendu dans le groupe i • R ésidu de Pearson : • R ésidu déviance : i ˆ

) ˆ 1( ˆ n ˆ n y r i i i

i i i i       ) ˆ log() (2 ) ˆ log( 2 ) ˆ ( i i

i i i i i

i i i i i y n

y n y n y

y y y y signe d      

i

i i ˆ n 

Analyse des résidus et validation du modèle proc l ogistic data =job; class race age sex region/ param =effect; model sat/total=race age sex region race*sex age*sex / scale = none ; output out = residu predicted =predicted reschi =reschi resdev =resdev; run ; Proc p rint data =residu; var sat total propsat predicted reschi resdev; run ;

79

Analyse des résidus : Résultats Obs sat total propsat predicted reschi resdev 1 288 465 0.61935 0.58848 1.35305 1.35864 2 90 135 0.66667 0.68991 -0.58388 -0.58005 3 226 354 0.63842 0.63003 0.32704 0.32756 4 285 464 0.61422 0.61011 0.18152 0.18164 5 270 450 0.60000 0.61875 -0.81897 -0.81651 6 252 378 0.66667 0.65641 0.41995 0.42097 7 119 177 0.67232 0.68338 -0.31638 -0.31541 8 60 117 0.51282 0.53231 -0.42246 -0.42216 9 19 31 0.61290 0.63909 -0.30364 -0.30214

V alidation du modèle • Le khi-deux de Pearson : • La déviance : • S i le modèle étudié est exact Q P et Q L suivent approximativement une loi du khi-deux à [nb de groupes - nb de paramètres du modèle] degrés de liberté.

  

s i i P r Q 1

2    s i i L d Q 1

2

(21)

81

Remarques • L es tests de validation sont valables s’il y a au moins 10 sujets par groupe. • L a déviance Q L est égale à où le modèle saturé est un modèle reconstituant parfaitement les données. [

2 (m odè le é tudié )] -[ -2 (m odè le sa tur é) ] LL

Résultats Deviance and Pearson Goodness-of-Fit Statistics Criterion DF Value Value/DF Pr > ChiSq Deviance 70 81.9676 1.1710 0.1552 Pearson 70 79.0760 1.1297 0.2142 Number of events/trials observations: 84 SUR-DISPERSION Khi-deux de Pearson Q

P

et déviance Q

L

sont trop forts si : - Modèle mal spécifié - O utliers Hétérogénéité de chaque groupe La variable de réponse Y

i

= Nb de succès sur le groupe i ne suit plus une loi binomiale : -E (Y

i

) = n

i

i

-V (Y

i

) = n

i

i

(1 -

i

)

83

CAL CUL DE Dans la Proc LOGISTIC : - O ption SCALE = Pearson : - O ption SCALE = Deviance : Dans la Proc GENMOD : - O ption PSCALE ou DSCALE - S cale = (vrai également dans Proc Logistic)

ddl Q P   ddl Q L   

(22)

SOL U TION L OGISTIC/GENMOD POUR PRENDRE EN COMPTE LA SUR-DISPERSION

Utilisation de la réponse binomiale pour l’estimation des paramètres. Pour les tests sur les coefficients : - L es statistiques de W a ld et LRT sont divisées par . - L es déviances sont divisées par . - D ans GENMOD, utilisation de la statistique S’il y a sur-dispersion (Déviance et Khi-deux de

Pearson significatifs) les résultats non corrigés sont trop significatifs.

85

    ) ( ) H sous (Modèle - ) H sous Modèle(

10

1 0 H H ddl ddl

Dev Dev F

B . LA RÉGRESSION LOGISTIQUE ORDIN A LE V a riables observées sur 34 années (1924 - 1957) TEMPERA T UR E : Somme des températures moyennes journalières SOLEIL : Durée d’insolation CHALEU R : Nombre de jours de grande chaleur PLUIE : Hauteur des pluies QUALITE DU VIN : Bon, Moyen, Médiocre

Exemple : Qualité des vins de Bordeaux

LES DONNÉES

87

3064120110361 2 3000105311338 3 3155113319393 2 30859704467 3 3245125836294 1 3267138635225 1 308096613417 3 2974118912488 3 3038110314677 3 3318131029427 2 3317136225326 1 3182117128326 3 299811029349 3 3221142421382 1 3019123016275 2 302212859303 2 3094132911339 2 3009121015536 3 3227133121414 2 3308136624282 1 3212128917302 2 3361144425253 1 3061117512261 2 3478131742259 1 3126124811315 2 3458150843286 1 3252136126346 2 3052118614443 3 3270139924306 1 3198125920367 1 290411646311 3 3247127719375 1 308311955441 3 3043120814371 3

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

TempératureSoleilChaleurPluieQualité

CORRÉLA TIONS

Correlations 1.712**.865** ..000.000 343434 .712**1.646** .000..000 343434 .865**.646**1 .000.000. 343434 -.410*-.473**-.401* .016.005.019 343434

Pearson Correlation Sig. (2-tailed) N Pearson Correlation Sig. (2-tailed) N Pearson Correlation Sig. (2-tailed) N Pearson Correlation Sig. (2-tailed) N

Température Soleil Chaleur Pluie

TempératureSoleilChaleurPluie Correlation is significant at the 0.01 level (2-tailed).**. Correlation is significant at the 0.05 level (2-tailed).*.

VIF

Coefficientsa .2114.733 .4512.216 .2484.031 .7601.316

Température Soleil Chaleur Pluie

Model 1ToleranceVIF

Collinearity Statistics Dependent Variable: Qualitéa.

(23)

LA RÉGRESSION L OGISTIQUE ORDIN A LE La variable Y prend 1,…, m, m+1 valeurs ordonnées. I. Le modèle à pentes égales pour i = 1, …, m et avec 1  2  m

89

k k 1 1 i

k k 1 1 i x x

x x e 1 e ) x/ i Y( Prob            

Dans la Pr oc Logistic : Dans SPSS :

kk11i

kk11i

x x α

x x α e 1 e )x /i Y( Prob          

Les coefficients de régr ession des x j de SPSS sont l’opposé de ceux de SAS :  j = -  j .

PR OPRIÉTÉS DU MODÈLE Modèle à pentes égales (proportional odds ratio) est indépendant de i. Lorsque j > 0, la probabilité des petites valeurs de Y augmente avec X j .

    

         )' x x( ' x

x e e e ) i/x' / Prob(Y) i/x' Prob(Y i/x) / Prob(Y i/x) Prob(Y i i TEST DU MODÈLE À PENTES ÉGALES D A NS SAS Le modèle général pour i = 1,…,m T est H 0 :

11

=

12

= … =

1m

21

=

22

= … =

2m

k1

=

k2

= … =

km

91

k ki 1 i1 i

k ki 1 i1 i x x

x x e 1 e ) x/ i Y( Prob            

  k(m-1) contraintes

ST A T ISTIQUE UTILISÉE Log-vraisemblance du modèle général = estimation de pour le modèle à pentes égales La statistique suit une loi du khi-deux à k(m-1) degrés de liberté sous l’hypothèse H 0 .

0 H ˆ 

000

1'2 2 ˆˆˆ

LL L '

HHH

Score

 

              



   

() L  

Références

Documents relatifs

We hypothesized that task-avoidance, self-avoidance, and especially other-avoidance goals were positive predictors of the four negative components of PE test anxiety

We devise a test for synthetic consciousness based on neural prosthetics, and explain how this test can supplement ACT.. We then identify two other kinds of

Optimalité asymptotique du test du rapport de vraisemblance pour déceler une rupture dans un modèle de régression.. Annales scientifiques de l’Université de Clermont-Ferrand 2,

Therefore, we also examine how much impact the cross-correlation due to the conservative approximation of error model on the actual integrity risk evaluation by comparing the

The asymptotic properties of the proposed estimate and the test statistic are studied under the null and alternative hypotheses, with simple and standard limit distributions both

We calculated the sample sizes required to detect linkage with each statistic, MLS c (estimated with constraints) and MLS u (estimated without constraints), using the exact

According to the TCGA batch effects tool (MD Anderson Cancer Center, 2016), the between batch dispersion (DB) is much smaller than the within batch dis- persion (DW) in the RNA-Seq

In order to reduce the number of obtained PEFs and keep only the most relevant ones, we developed a feature selection method, which is based on the chi-square (KHI²)