Innhold Multisample inference - del (Rosner,.5 -.7) Stian Lydersen.5.: Sammenheng mellom enveis ANOVA og multippel lineær regresjon: Indiatorvariable.5. samt Vicers & Altman (BMJ Nov 00): Kovariansanalyse (ANCOVA).6: Toveis ANOVA og interasjon.7: Krusall-Wallis test Altman..5: Friedmans test Data Effect of Lead Exposure (Es. i Rosner Kap..5 mm) Les inn lead.xls fra Rosnerdata MAXFWT = MAX(fwt_l, fwt_r) Group er variabelen lead_type Mer at 99 betyr MISSING Fjern de 4 cases med id 49, 0,,. (Dette er outliers som ble identifisert i Section 8.9, Examples 8.5, 8.6) Datafilen finnes på hjemmesiden til faget KLMED 8005. Lead_type Blood-lead level in the child GROUP Normal (<40 μg/00ml) Control in both 97 and 97 Elevated ( 40 μg/00ml) in 97 Currently exposed Elevated in 97 and normal in 97 Previously exposed 4 90 80 7 Rosner, Table.7 og.8 (.5 og.6 i 5th edition) Report 70 60 50 MAXFWT Lead_type N Mean Std. Deviation Minimum Maximum 55,0 0,95 84 6 7 47,59 7,080 4 58 5 49,40 0,97 5 70 95 5,85 0,68 84 40 MAXFWT 0 0 0 N = 4 0 6 7 5 MAXFWT Between Groups Within Groups ANOVA Sum of Squares df Mean Square F Sig. 966,79 48,95 4,598,0 967,46 9 05, 067,97 94 Lead_type 5 6
Multippel regresjon som alternativ til enveis ANOVA En ategoris variabel C med nivåer {,,, } representeres med - dummy variable (indiatorvariable): x = (0) hvis C= ( ) x = (0) hvis C= ( ) x - = (0) hvis C= ( ) Referansegruppe (her =0) velger du selv. Kan gjøres automatis i SPSS: General Linear Model -> Univariate Legg inn ategorivariablene som Fixed factor 7 Koding av indiatorvariable C x x x - 0 0 0 0 0 0 0 0 0 8 Regresjonsmodell: y = α + β GRP + β GRP + e Enveis ANCOVA ANOVA b Sum of Model Squares df Mean Square F Sig. Regression 966,79 48,95 4,598,0 a Residual 967,46 9 05, 067,97 94 a. Predictors: (Constant), GRP, GRP b. Dependent Variable: MAXFWT Coefficients a Unstandardized Standardized Coefficients Coefficients ANOVA med justering for andre ovariater Fordeler: Unngå sjevheter pga onfundering Mer presis estimering (hypotesetesting) Model (Constant) GRP GRP B Std. Error Beta t Sig. 55,095,9 4,65,000-7,507,80 -,7 -,679,009-5,695,946 -,96 -,9,056 Esempel.6: a. Dependent Variable: MAXFWT 9 y = α + β GRP + β GRP + β age + β 4 sex + e 0 SPSS Regression -> Linear SPSS General Linear Model -> Univariate Tests of Between-Subjects Effects Dependent Variable: MAXFWT Coefficients a Unstandardized Standardized Coefficients Coefficients Model B Std. Error Beta t Sig. (Constant),958,0 0,85,000 GRP -5,78,974 -,9 -,674,009 GRP -4,97,06 -,70 -,9,09 AGE,449E-0,00,705 9,99,000 SEX -,408,55 -, -,589,6 a. Dependent Variable: MAXFWT Type III Sum Partial Eta Source of Squares df Mean Square F Sig. Squared Corrected Model 607,809 a 4 504,45 9,07,000,566 Intercept 557,87 557,87 00,475,000,57 LEAD_TYP 549,784 74,89 5,55,006,06 AGE 5050,89 5050,89 98,80,000,5 SEX 9,6 9,6,55,6,07 Error 460,8 90 5,5 760,000 95 Corrected 067,97 94 a. R Squared =,566 (Adjusted R Squared =,546)
SPSS General Linear Model -> Univariate (forts.) Parameter Estimates Dependent Variable: MAXFWT 95% Confidence Interval Partial Eta Parameter B Std. Error t Sig. Lower Bound Upper Bound Squared Intercept 9,0,5 8,70,000,057 6,006,4 [LEAD_TYP=] 4,97,06,9,09,8 9,0,060 [LEAD_TYP=] -,5,548 -,8,89-5,4 4,70,000 [LEAD_TYP=] 0 a,,,,,, AGE,449E-0,00 9,99,000,959E-0,940E-0,5 SEX -,408,55 -,589,6-5,48,60,07 a. This parameter is set to zero because it is redundant. Mer: SPSS default er siste nivå (her lead_typ = ) som referanse Pococ, S. J. & al: Subgroup analysis, covariate adjustment and baseline comparison in clinical trial reporting: current practice and problems. Statistics in medicine 00; : 97-90. p 97: Overall, what matters is to adjust for the appropriate covariates (that is, the strong predictors of outcome) and to mae one s statistical policy for covariate adjustment completely objective. 4 God artiel om ANCOVA: Vicers, A. J. and Altman, D. G.: Statistics Notes: Analysing controlled trials with baseline and follow up measurements BMJ, Nov 00; : - 4 Esempel på besrivelse i Methods : To adjust for baseline scores, we used analysis of covariance to compare outcome between the two groups. Sluttverdi eller endring som outcome? Inludere baseline verdi i analysen? Vicers, A J and Altman, D G: Analysing controlled trials with baseline and follow up measurements BMJ, vol, 0 nov 00, -4. 5 6 Table from Vicers and Altman Alternative analyses Not including baseline Follow up score Change score Including baseline Follow up score (ANCOVA) Change score: Not correct. Change is usually negatively correlated with baseline 7 8
Analysis not including baseline Follow up score: Most significant if low correlation with baseline Change score: Most significant if baseline and follow up are highly correlated Effect of baseline score if not included If, by chance, worse baseline scores in treatment group: Follow up score analysis underestimates effect Change score analysis overestimates effect If average baseline in the groups are equal Unbiased effect estimate in both analyses, but low power (wide confidence intervals) 9 0 ANCOVA (Actually regression analysis) Figure from Vicers and Altman Follow up score = constant + a baseline score + b group =4.0 + 0.7 baseline score +.7 group.6: Toveis variansanalyse. Esempel Table.4 (. in 5th ed): Mean systolic blood pressure by dietary group and sex Dietary group Male Female SV mean 09.9 0.6 n 8 88 LV mean 5.5 05. n 6 7 Normal mean 8. 9.6 n 40 0 Toveis variansanalyse y ij = μ + α i + β j + γ ij + e ij hvor y ij er resultat for te person i i te diettgruppe og j te jønn μ er en onstant α i er effet av rad i (gruppe i) β j er effet av olonne j (jønn j) γ ij er samspill (interaction) mellom gruppe i og jønn j e ij N(0, σ ) representerer variasjon innen cellen (rad og olonne) 4 4
Fremgangsmåte: Test først samspillet, dvs H 0 : γ ij =0 for alle i,j. Hvis samspillet er signifiant, har både rad og olonne effet Hvis linjene er (tilnærmet) parallelle, er det ie samspill Hvis samspillet ie er signifiant brues modell uten samspill: y ij = μ + α i + β j + e ij Test H 0 : α i =0 for alle i og/eller β j = 0 for alle j (Rosner gjør bare det siste!) 5 6 Samspill betyr: Effet av rad (diett) er forsjellig i forsjellige olonner (jønn) Samspill betyr ie: Hvorvidt rad og olonne er assosiert (f.es orrellert) Toveis ANCOVA Esempel. (.9 i 5th ed): x = if diet group x = if diet group sex has only two values (groups). y = α + β x + β x + β sex + β 4 age + β 5 weight + e 7 8 Sammenlining mellom grupper: = > Normalfordelte data To-utvalgs t-test ) enveis ANOVA ) Ie normalfordelt Wilcoxon-Mann- Whitney s test Krusall-Wallis test ) Alternativt multippel lineær regresjon med indiatorvariable for gruppene. Kan også brues ved justering for ovariater (f.es alder, jønn). Table.7 (.6 in 5 th ed): Ocular anti.inflammatory effects of 4 drugs on lid closure Rabbit Indomethicin Aspirin Piroxicam BW775C no Score Score Score Score + + + + + + + 0 + + + 0 4 + + + 0 5 + + + 0 6 0 + + - Note: There are 6x4 = 4 rabbits! 9 0 5
Table.8 (.7 in 5th ed). Assigment of rans Lid-closure score Frequency Range of rans Average ran -.0 0 5 6 4.0 5 7 9.0 4 5.5 9 6 4 0.0 Table.7 (.6 in 5 th ed): Ocular anti.inflammatory effects of 4 drugs on lid closure Rabbit no Indomethicin Aspirin Piroxicam BW775C Score Ran Score Ran Score Ran Score Ran +.5 + 9.0 + 0.0 + 9.0 + 0.0 + 0.0 + 9.0 0 4.0 + 0.0 + 9.0 +.5 0 4.0 4 + 0.0 +.5 + 9.0 0 4.0 5 + 0.0 +.5 + 0.0 0 4.0 6 0 4.0 + 0.0 + 0.0 -.0 Krusall-Wallis test: grupper, gruppe nr i har n i observasjoner og rangsum R i. N = n. i= i SPSS: Nonparametric tests -> independent samples Rans * Ri H = ni[ Ri / ni ( N + )/ ] = ( N + ) N( N + ) i= N( N + ) i= ni E( Ri / ni) under H0 Lettere å regne ut LIDSCORE DRUG Indomechitin Aspirin Piroxicam BW755C N Mean Ran 6 6,5 6 4,7 6 5,5 6 4, 4 H = H * g ( tj tj) j= N N hvor t j er antall sammenfallende observasjoner i lynge nr j er tilnærmet χ under H 0. Test Statistics a,b Chi-Square df Asymp. Sig. Exact Sig. Point Probability a. Krusal Wallis Test LIDSCORE,804,008,00,000 b. Grouping Variable: DRUG 4.7. Multiple sammenlininger (Dunn prosedyren) Regn ut z = Ri R j N( N + ) + ni n j * α Forast H 0 hvis z > z * α hvor α = ( ) Mer at dette tilsvarer Bonferroni orresjon Es. (Forts) Rans DRUG LIDSCORE Indomechitin Aspirin Piroxicam BW755C N Mean Ran 6 6,5 6 4,7 6 5,5 6 4, 4 z = 0.5, z = 0.4, z4 =.9, z = -0.7, z4 =.4, z4 =.67 * 0.05 α = = 0.004, z-0.004 =.64 4(4 ) Altså: Gruppe og 4 er forsjellige Gruppe og 4 er forsjellige 5 6 6
Friedman s to-veis ANOVA (Altman,..5) Krever ie normalfordeling n subjeter og grupper. Én observasjon per celle (subjet og gruppe). Få eller ingen sammenfallende observasjoner. H 0 (H ) : Det er ie (er) forsjell på gruppene Table.9 Immersion suit leaage (g) during simulated helicopter underwater escape (Light et al., 987) From Altman (99) Suit type Subject A B C D 08 454 64 0 56 0 8 8 4 96 0 4 68 4 64 90 5 66 8 4 4 6 96 458 6 7 98 50 00 90 8 8 74 6 4 Mean 98 8 0 45.7 SD 0 7 79.6 7 8 Table.0. Rans of the data in Table.9. From Altman (99) Suit type Subject A B C D 4 4 4 4 4 5 4 6 4 7 4 8 4 (R) 4 7 9 0 Mean ran.00.8.8.5 Friedman s test: H = [ R n( )/] R n( ) n( + ) + = ( + ) + i i i= n i= E( Ri ) under H0 Lettere å regne ut er tilnærmet χ under H 0. (R i er rangsum i gruppe i) Esempel: H = [4 + 7 + 9 + 0 ] 8 5 =.45 8 4 5 p-verdi P( χ.45) = 0.006 4 9 40 Friedman s test i SPSS: Friedman Test Et case pr subjet, en variabel pr gruppe Analyse -> Nonparametric tests -> related samples Opsjonen Exact gir p-verdien esat ( Exact Sig. ) i tillegg til jivadratfordeligens tilnærming ( Asymp. Sig ) 4 A B C D Rans Mean Ran,00,8,8,5 Test Statistics a N Chi-Square df Asymp. Sig. Exact Sig. Point Probability a. Friedman Test 8,450,006,00,000 4 7
Hvile grupper er forsjellige? Friedman s test forteller om minst to grupper er forsjellige. (I esempelet har D åpenbart lavere verdier) Par av grupper an sammenlines vha Wiloxons test for matchede par. Juster for multiple sammenlininger. Friedman s test for grupper tilsvarer tegntesten! 4 8