Multivariata metoder F5 Linda Wänström Linköpings universitet 1 oktober Wänström (Linköpings universitet) Multivariata metoder 1 oktober 1 / 18
Kanonisk korrelationsanalys Syfte: Undersöka om en grupp (uppsättning) av variabler påverkar en annan grupp variabler Undersöka om två grupper av variabler är relaterade till varandra Wänström (Linköpings universitet) Multivariata metoder 1 oktober 2 / 18
Exempel (Hotelling, 1936) X 1 = lässnabbhet, X 2 = lässtyrka, Y 1 = mattesnabbhet, Y 2 = mattestyrka Finns det något samband mellan läs-och matte-variablerna? U 1 = a 1 X 1 + a 2 X 2 V 1 = b 1 Y 1 + b 2 Y 2 Välj linjärkombinationer så att U 1 och V 1 blir så starkt korrelerade som möjligt. Wänström (Linköpings universitet) Multivariata metoder 1 oktober 3 / 18
Kanonisk korrelationsanalys Antag två grupper av variabler X = (X 1, X 2,..., X p ) och Y = (Y 1, Y 2,..., Y q ) med kovariansmatris ( ΣXX Σ Σ = XY Σ YX Σ YY där q p. Vi kan bilda högst q par av kanoniska variabler U i = a i X och V i = b i Y. U 1 och V 1 bestäms så att korrelationen (eller kvadrerade korrelationen) ) ρ 2 (a 1 U 1 V 1 = Σ XY b 1 ) 2 a 1 Σ XX a 1 b 1Σ YY b 1 maximeras. U 2 och V 2 bestäms så att korrelationen mellan dessa maximeras (ρ U2 V 2 ) givet att de är okorrelerade med U 1 och V 1 osv. Wänström (Linköpings universitet) Multivariata metoder 1 oktober 4 / 18
Kanonisk korrelationsanalys Från Σ kan vi beräkna en p p-matris och en q q-matris Σ 1 XX Σ YX Σ 1 YY Σ YX Σ 1 YY Σ XY Σ 1 XX Σ XY Dess egenvärden är de kvadrerade kanoniska korrelationerna och första matrisens egenvektorer är a 1, a 2,..., a r och andra matrisens egenvektorer är b 1, b 2,..., b r. Wänström (Linköpings universitet) Multivariata metoder 1 oktober 5 / 18
Signifikanstest Test för H 0 : ρ U1 = ρ V 1 U2 =... = ρ V 2 Ur Vr = 0 (H 0 : Σ XY = 0) Om data är multivariat normalfördelat kan man bilda ett likelihoodkvottest så att H 0 förkastas om {n 12 } (p + q + 3) r i=1 log e (1 λ i ) χ 2 (1 α);pq där n är stickprovsstorleken. Wänström (Linköpings universitet) Multivariata metoder 1 oktober 6 / 18
Tolkning av kanoniska variabler Tolka de par av kanoniska variabler vars kanoniska korrelationer är signifikanta Tolka utifrån de standardiserade koeffi cienterna (liknande PC och CDA) Tolka utifrån variablers korrelationer med de kanoniska variablerna Wänström (Linköpings universitet) Multivariata metoder 1 oktober 7 / 18
Steg i kanonisk korrelationsanalys 1 Ta fram par av kanoniska variabler samt kanoniska korrelationer 2 Testa om alla kanoniska korrelationer är noll. Bedöm hur många par av kanoniska variabler som ska sparas 3 Tolka de kanoniska variablerna som sparats och sambanden dem emellan 4 Undersök hur stor del av variationen i ena gruppen variabler som kan förklaras av den andra gruppen variabler Wänström (Linköpings universitet) Multivariata metoder 1 oktober 8 / 18
Exempel Finns det något samband mellan barns familjebakgrund (mammas IQ, mammas ålder vid första barnets födsel, hushållsinkomst, mammas utbildningsnivå, syskonstorlek, födelseordning) och IQ (ds, pm, prr, prc, ppvt)? proc cancorr data=seven all vprefix= vname=' variables' wprefix=iq wname='iq variables'; var iqmom momage_firtsbirth hh_income motheduc sibsize birthorder; with ds pm prr prc ppvt; run; Wänström (Linköpings universitet) Multivariata metoder 1 oktober 9 / 18
The CANCORR Procedure variables 6 IQ variables 5 Observations 377 Means and Standard Deviations Variable Mean Standard Deviation iqmom 48002 30043 momage_firtsbirth 26.424403 5.180286 HH_income 90233 98201 MothEduc 13.933687 2.728564 sibsize 2.729443 1.349156 birthorder 2.294430 1.271954 ds 10.498674 3.395182 pm 106.448276 15.516227 prr 107.220159 14.756060 prc 102.148541 13.816010 ppvt 99.588859 22.203560 Wänström (Linköpings universitet) Multivariata metoder 1 oktober 10 / 18
Correlations Among the variables iqmom momage_firtsbirth HH_income MothEduc sibsize birthorder iqmom 1.0000 0.3908 0.3932 0.5750 0.2272 0.2765 momage_firtsbirth 0.3908 1.0000 0.3075 0.4355 0.6426 0.7314 HH_income 0.3932 0.3075 1.0000 0.3679 0.1709 0.2423 MothEduc 0.5750 0.4355 0.3679 1.0000 0.2960 0.3308 sibsize 0.2272 0.6426 0.1709 0.2960 1.0000 0.8912 birthorder 0.2765 0.7314 0.2423 0.3308 0.8912 1.0000 Correlations Among the IQ variables ds pm prr prc ppvt ds 1.0000 0.4145 0.4893 0.4568 0.3431 pm 0.4145 1.0000 0.5488 0.5964 0.5542 prr 0.4893 0.5488 1.0000 0.6774 0.5862 prc 0.4568 0.5964 0.6774 1.0000 0.6558 ppvt 0.3431 0.5542 0.5862 0.6558 1.0000 Correlations Between the variables and the IQ variables ds pm prr prc ppvt iqmom 0.3120 0.4894 0.4168 0.5285 0.5076 momage_firtsbirth 0.1847 0.3304 0.2728 0.3169 0.3414 HH_income 0.2544 0.2875 0.2460 0.2710 0.2283 MothEduc 0.2505 0.3185 0.2552 0.3421 0.3291 sibsize 0.1313 0.2314 0.2511 0.2788 0.2513 birthorder 0.1733 0.2375 0.2519 0.2962 0.2914 Wänström (Linköpings universitet) Multivariata metoder 1 oktober 11 / 18
Canonica l Correlati on Adjusted Canonica l Correlati on Approxim ate Standard Error Squared Canonica l Correlati on Canonical Correlation Analysis Eigenval ue Eigenvalues of Inv(E)*H = CanRsq/(1 CanRsq) Differen ce Proporti on Cumulati ve Test of H0: Thecanonicalcorrelations in the current row and all that fol low are zero Likelihood Ratio Approximate F Value Num DF Den DF Pr > F 1 0.624822 0.613382 0.031438 0.390403 0.6404 0.6132 0.9085 0.9085 0.57192119 7.33 30 1466 <.0001 2 0.162788. 0.050204 0.026500 0.0272 0.0065 0.0386 0.9471 0.93819513 1.18 20 1218.2 0.2601 3 0.142470. 0.050524 0.020298 0.0207 0.0064 0.0294 0.9765 0.96373417 1.14 12 973.93 0.3224 4 0.118949. 0.050841 0.014149 0.0144 0.0122 0.0204 0.9969 0.98370113 1.01 6 738 0.4143 5 0.046700. 0.051459 0.002181 0.0022 0.0031 1.0000 0.99781908 0.40 2 370 0.6677 Multivariate Statistics and F Approximations S=5 M=0 N=182 Statistic Value F Value Num DF Den DF Pr > F Wilks' Lambda 0.57192119 7.33 30 1466 <.0001 Pillai's Trace 0.45353034 6.15 30 1850 <.0001 Hotelling Lawley Trace 0.70490463 8.57 30 964.95 <.0001 Roy's Greatest Root 0.64042729 39.49 6 370 <.0001 NOTE: F Statistic for Roy's Greatest Root is an upper bound. Wänström (Linköpings universitet) Multivariata metoder 1 oktober 12 / 18
Canonical Correlation Analysis Raw Canonical Coefficients for the variables 1 2 3 4 5 iqmom 0.0000269941 0.000010752 0.000012571 4.982797E 6 0.000011536 momage_firtsbirth 0.0291847452 0.115993336 0.0238858973 0.2561781336 0.0918518181 HH_income 1.0772696E 6 2.6114281E 6 0.0000103104 1.679463E 6 3.0587007E 6 MothEduc 0.000025089 0.2439409462 0.000437429 0.0354440565 0.218146926 sibsize 0.125937531 1.2286194348 0.624799869 0.5495120163 0.4105385168 birthorder 0.003484457 1.396807826 0.9499579949 0.453364447 0.792481077 Raw Canonical Coefficients for the IQ variables IQ1 IQ2 IQ3 IQ4 IQ5 ds 0.0214478153 0.3195010894 0.1272278669 0.0023396051 0.0493748041 pm 0.0229642694 0.030512788 0.0464538819 0.0566382039 0.023272986 prr 0.0002399785 0.048320295 0.0290242571 0.043288953 0.0703273354 prc 0.0289294279 0.0039348821 0.023623791 0.065230793 0.085720855 ppvt 0.0163847943 0.0149303425 0.044718546 0.0278421107 0.0272359476 Wänström (Linköpings universitet) Multivariata metoder 1 oktober 13 / 18
Canonical Correlation Analysis Standardized Canonical Coefficients for the variables 1 2 3 4 5 iqmom 0.8110 0.3230 0.3777 0.1497 0.3466 momage_firtsbirt h 0.1512 0.6009 0.1237 1.3271 0.4758 HH_income 0.1058 0.2564 1.0125 0.1649 0.3004 MothEduc 0.0001 0.6656 0.0012 0.0967 0.5952 sibsize 0.1699 1.6576 0.8430 0.7414 0.5539 birthorder 0.0044 1.7767 1.2083 0.5767 1.0080 Standardized Canonical Coefficients for the IQ variables IQ1 IQ2 IQ3 IQ4 IQ5 ds 0.0728 1.0848 0.4320 0.0079 0.1676 pm 0.3563 0.4734 0.7208 0.8788 0.3611 prr 0.0035 0.7130 0.4283 0.6388 1.0378 prc 0.3997 0.0544 0.3264 0.9012 1.1843 ppvt 0.3638 0.3315 0.9929 0.6182 0.6047 Wänström (Linköpings universitet) Multivariata metoder 1 oktober 14 / 18
Canonical Structure Correlations Between the variables and Their Canonical Variables 1 2 3 4 5 iqmom 0.9515 0.0403 0.0730 0.0317 0.2320 momage_firtsbirt h 0.6130 0.1241 0.0541 0.3618 0.5549 HH_income 0.5013 0.3367 0.7537 0.0467 0.2410 MothEduc 0.6228 0.4095 0.0603 0.1177 0.3073 sibsize 0.4733 0.2929 0.0668 0.4361 0.4466 birthorder 0.5163 0.0529 0.2252 0.3161 0.6425 Correlations Between the IQ variables and Their Canonical Variables IQ1 IQ2 IQ3 IQ4 IQ5 ds 0.5297 0.6782 0.4505 0.1399 0.1922 pm 0.8284 0.1990 0.3900 0.3367 0.0932 prr 0.7187 0.2109 0.2320 0.4007 0.4738 prc 0.8864 0.0020 0.0602 0.4008 0.2235 ppvt 0.8505 0.0590 0.4082 0.1425 0.2938 Wänström (Linköpings universitet) Multivariata metoder 1 oktober 15 / 18
Correlations Between the variables and the Canonical Variables of the IQ variables IQ1 IQ2 IQ3 IQ4 IQ5 iqmom 0.5945 0.0066 0.0104 0.0038 0.0108 momage_firtsbirth 0.3830 0.0202 0.0077 0.0430 0.0259 HH_income 0.3132 0.0548 0.1074 0.0056 0.0113 MothEduc 0.3891 0.0667 0.0086 0.0140 0.0144 sibsize 0.2958 0.0477 0.0095 0.0519 0.0209 birthorder 0.3226 0.0086 0.0321 0.0376 0.0300 Correlations Between the IQ variables and the Canonical Variables of the variables 1 2 3 4 5 ds 0.3310 0.1104 0.0642 0.0166 0.0090 pm 0.5176 0.0324 0.0556 0.0400 0.0044 prr 0.4491 0.0343 0.0331 0.0477 0.0221 prc 0.5539 0.0003 0.0086 0.0477 0.0104 ppvt 0.5314 0.0096 0.0582 0.0169 0.0137 Wänström (Linköpings universitet) Multivariata metoder 1 oktober 16 / 18
Canonical Redundancy Analysis Standardized Variance of the variables Explained by Canonical Variable Number Their Own Canonical Variables Proportion Cumulative Proportion Canonical R Square The Opposite Canonical Variables Proportion Cumulative Proportion 1 0.4018 0.4018 0.3904 0.1569 0.1569 2 0.0644 0.4662 0.0265 0.0017 0.1586 3 0.1059 0.5721 0.0203 0.0021 0.1607 4 0.0730 0.6451 0.0141 0.0010 0.1618 5 0.1877 0.8328 0.0022 0.0004 0.1622 Canonical Variable Number Standardized Variance of the IQ variables Explained by Their Own Canonical Variables Proportion Cumulative Proportion Canonical R Square The Opposite Canonical Variables Proportion Cumulative Proportion 1 0.5985 0.5985 0.3904 0.2337 0.2337 2 0.1095 0.7080 0.0265 0.0029 0.2366 3 0.1158 0.8238 0.0203 0.0024 0.2389 4 0.0949 0.9187 0.0141 0.0013 0.2403 5 0.0813 1.0000 0.0022 0.0002 0.2404 Wänström (Linköpings universitet) Multivariata metoder 1 oktober 17 / 18
Canonical Redundancy Analysis Squared Multiple Correlations Between the variables and the First M Canonical Variables of the IQ variables M 1 2 3 4 5 iqmom 0.3534 0.3535 0.3536 0.3536 0.3537 momage_firtsbirth 0.1467 0.1471 0.1472 0.1490 0.1497 HH_income 0.0981 0.1011 0.1126 0.1127 0.1128 MothEduc 0.1514 0.1559 0.1559 0.1561 0.1563 sibsize 0.0875 0.0897 0.0898 0.0925 0.0930 birthorder 0.1041 0.1041 0.1052 0.1066 0.1075 Squared Multiple Correlations Between the IQ variables and the First M Canonical Variables of the variables M 1 2 3 4 5 ds 0.1095 0.1217 0.1258 0.1261 0.1262 pm 0.2679 0.2690 0.2721 0.2737 0.2737 prr 0.2017 0.2029 0.2040 0.2062 0.2067 prc 0.3068 0.3068 0.3068 0.3091 0.3092 ppvt 0.2824 0.2825 0.2858 0.2861 0.2863 Wänström (Linköpings universitet) Multivariata metoder 1 oktober 18 / 18