Grup Analysis: Hands-On Gang Chen SSCC/NIMH/NIH/HHS 3/19/16 1
Make sure yu have the files!! Under directry grup_analysis_hands_n/! Slides: GrupAna_HO.pdf! Data: AFNI_data6/GrupAna_cases/! In case yu dn t have the data! wget http://afni.nimh.nih.gv/pub/dist/edu/data/afni_data6.tgz! Require R installatin! Ggle R, and then dwnlad prper binaries! Install a few R packages: install.packages( afex )! afex, phia, snw, nlme, lme4, cntrast! Install via a cmmand line: rpkgsinstall - pkgs ALL! Install via a cmmand line: rpkgsinstall - pkgs ALL - check!!
Preview: chsing prgrams! Prgram list! 3dttest++, 3dMEMA, 3dANOVAx, 3dMVM, 3dLME! 3ttest, 3dRegAna, GrupAna almst cmpletely retired! Vxel-wise apprach! ROI analysis nt discussed: R, Matlab, Excel, SAS, SPSS! uber_ttest.py: fr 3ttest++ and 3dMEMA nly! Other prgrams: scripting (t hard? Rick Reynlds!) gen_grup_cmmand.py! Typical mistakes! Extra spaces after the cntinuatin character BACKSLASHES (\)! file_tl test infile! Typs! Mdel specificatins, misuses f ptins,!
Preview: chsing prgrams! Data layut shuld nt always be the nly fcus! Experiment design: number f explanatry variables (factrs and quantitative variables), levels f a categrical variable! Balance: equal number f subjects acrss grups?! Missing data: thrw ut thse subjects, r keep the partial data?! List all the tests yu wuld like t get ut f the grup analysis! If cmputatin cst is f cncern! Super fast prgrams: 3dttest++, 3dANOVAx, 3dttest, 3dRegAna! Super slw prgrams: 3dMEMA, 3dMVM, 3dLME, GrupAna! Special features f 3dMEMA! Weights subjects based n reliability f!" Mdels and identifies utliers at vxel level! Handles missing data at vxel level (e.g. ECG data)! Crss-subjects variability measures (" 2, H, I 2, ICC) and grup cmparisns in " 2!
Mdel specificatins in 3dMVM & 3dLME (R)! Fixed-effects frmula: R cnventin! A*B = A + B + A:B! A+B: presuming n interactin! A:B: usually des nt make sense! Randm-effect frmula! ~1: randm intercept (each subject deviates t sme extent frm the grup average)! ~x: randm slpe fr quantitative variable x (the x effect fr each subject deviates sme amunt frm the grup average)! ~pdcmpsymm(~0+a): presuming cmpund symmetry fr the levels f factr (categrical variable) A! Slightly mre general than assuming statistical independence!
Rad Map: Chsing a prgram? Starting with HRF estimated via fixed-shape methd (FSM) One! per cnditin per subject It culd be significantly underpwered Tw perspectives Data structure Ultimate gal: list all the tests yu want t perfrm Pssible t avid a big mdel Use a piecemeal apprach with 3dttest++ r 3dMEMA Mst analyses can be dne with 3dMVM and 3dLME Cmputatinally inefficient Last resrt: nt recmmended if alternatives available
Rad Map: Student s t-tests 3dttest++ and 3dMEMA Nt fr F-tests except fr nes with 1 DF fr numeratr All factrs are f tw levels, e.g., 2 x 2, r 2 x 2 x 2 Scenaris One-, tw-sample, paired Multiple regressin: ne grup + ne r mre quantitative variables ANCOVA: tw grups + ne r mre quantitative variables ANOVA thrugh dummy cding: all factrs (between- r withinsubject) are f tw levels AN(C)OVA: multiple between-subjects factrs + ne r mre quantitative variables
Rad Map: Between-subjects ANOVA One-way between-subjects ANOVA 3dANOVA Tw grups: 3dttest++, 3dMEMA (OK with > 2 grups t) Tw-way between-subjects ANOVA 3dANOVA2 type 1 2 x 2 design: 3dttest++, 3dMEMA (OK with > 2 grups t) Three-way between-subjects ANOVA 3dANOVA3 type 1 2 x 2 design: 3dttest++, 3dMEMA (OK with > 2 grups t) N-way between-subjects ANOVA 3dMVM
Rad Map: Within-subject ANOVA One-way within-subject ANOVA 3dANOVA2 type 3 Tw cnditins: 3dttest++, 3dMEMA Tw-way within-subject ANOVA 3dANOVA3 type 4 2 x 2 design: 3dttest++, 3dMEMA N-way within-subject ANOVA 3dMVM
Rad Map: Mixed-type ANOVA and thers One between- and ne within-subject factr 3dANOVA3 type 5 (requiring equal # subjects acrss grups) 3dMVM (especially unequal # subjects acrss grups) 2 x 2 design: 3dttest++, 3dMEMA Other scenaris Multi-way ANOVA: 3dMVM Multi-way ANCOVA (between-subjects cvariates nly): 3dMVM HDR estimated with multiple basis functins: 3dMVM Missing data: 3dLME Within-subject cvariates: 3dLME Subjects genetically related: 3dLME Trend analysis: 3dLME
Preview: learning by 8 examples! BOLD respnses estimated with ne basis functin! 1 grups, 2 cnditins! 1 grup, 3 cnditins with missing data! 3 grups, 1 numeric variable (between-subjects)! ANOVA! ANCOVA! Within-subject cvariate! BOLD respnses estimated with multiple basis functins! 1 grup! 2 grups!
Case 0: tw cnditins! Class example yu ve been shwn several times! 1 grup: 10 subjects! 2 cnditins: reliable visual and reliable auditry! Data structure! 2 effect estimates (2 sub-bricks) frm each subjects! All subjects aligned t standard space AFNI_data6/grup_results 3dinf verb OLSQ.FP.betas+tlrc! Analysis appraches! What are we lking fr at the grup level?! Grup effect fr each cnditin: 2 ne-sample t-tests! Cmparisn between the 2 cnditins: paired t-test! Prgrams! uber_ttest.py! gen_grup_cmmand.py Write 3dttest++ script directly!
Case 1: three cnditins! Run cmmand line! tcsh x LME.txt! tcsh x LMEtable.txt! MEG data! 3 cnditins: Baseline, Ket, Placeb! 17 subject with missing data: 11 with full data! Analysis appraches! One-way within-subject ANOVA! Wrst: wasting 6 subjects! 3 pairwise cmparisns with t-test! Better: partially wasting subjects! LME! Best: all data fully utilized! Overall F-stat plus 3 pairwise cntrasts! Subj Baseline Ket Placeb S101 1 1 0 S102 1 1 1 S105 1 1 1 S107 1 1 1 S108 1 1 1 S109 1 1 1 S110 1 1 1 S111 1 1 0 S112 0 1 1 S113 1 1 1 S115 0 1 1 S116 1 1 0 S118 1 1 1 S120 1 1 1 S121 1 1 0 S122 1 1 1 S123 1 1 1
Case 1: three cnditins! Put the data table in a separate text file! Unix issue ( Arg list t lng): the whle cmmand line beynd the system allws! Same dataset can be used fr different mdels! Nt all clumns have t be used! Navigate the utput dataset!
Case 2: three grups! Data infrmatin! COMT (catechl-o-methyl transferase) gene with a Val/Met (valine-tmethinine) plymrphism fr schizphrenia! 3 gentypic grups: Val/Val (12), Val/Met (10), Met/Met (9)! 1 effect estimate frm each subject! What prgram?! Almst everybdy immediately jumps t this questin!! Tests f interest?! Individual grup effects: A, B, and C! Pairwise grup cmparisns: A-B, A-C, and B-C: Tw-sample t-test! Any difference acrss all three grups? Omnibus F-test! What prgram?! One- r tw-sample t-test: 3dttest++, 3dMEMA! One-way between-subjects ANOVA: 3dANOVA, 3dMVM!
Case 2: three grups! One-way between-subjects ANOVA! Each subject has nly ne respnse value!! GLM, nt really a randm-effects mdel:! ˆ i(j) = 0 + 1 x 1i(j) + 2 x 2i(j) + i(j) Cding fr subjects: with ne grup (A) as base (reference) fr dummy cding (0s and 1s), α 0 = A, α 1 = B A, and α 2 = C A.! 3dANOVA! Dn t directly slve GLM! Cmpute sums f squares: cmputatinally efficient!! Alternatives: 3dttest++, 3dMEMA!
Case 3: multi-way ANOVA! Data infrmatin! 1 subject-gruping variable (Grup): yung (15) and lder (14)! 3 within-subject factrs:! task - 2 levels: Perceptin and Prductin! Syllable - 2 levels: Simple and Cmplex! Sequence - 2 levels: Simple and Cmplex! Tests f interest?! Cmparisns under varius cmbinatins! Interactins amng the 4 factrs! What prgram?! 3dttest++, 3dMEMA, 3dMVM!
Case 4: Within-subject cvariate! Data infrmatin! 1 within-subject variable: Cnditin (2 levels: huse, face)! 1 quantitative (within-subjects) variable: RT (mean RT nt significantly different acrss cnditins)! Tests f interest?! Main effects, interactins, varius cntrasts! Mdel! What prgram? 3dLME! ˆ ij = 1 x 1j +... + k x kj + i + ij
Case 5: ne grup with multiple basis functins! Data infrmatin! 15 subjects! One effect f interest mdeled with 8 basis (TENT) functins! Tests f interest?! Any verall respnse at a vxel (brain regin)?! Mdel! ˆ ij = 1 x 1j +... + k x kj + i + ij N intercept! Test f interest:! 1 =... = k =0 Residuals ε ij are mst likely serially crrelated! What prgram? 3dLME!
Case 6: tw grups with multiple basis functins! Data infrmatin! 15 subjects! One effect f interest mdeled with 8 basis (TENT) functins! Tests f interest?! Any verall respnse at a vxel (brain regin)?! Mdel! N intercept! Test f interest:! Residuals ε ij are mst likely serially crrelated! What prgram? 3dANOVA3 type 5, 3dMVM!
Case 7: ANCOVA! Data infrmatin! 2 subject-gruping variables! Grup (2 levels): cntrl () and ssd ()! Gender (2 levels): males () and females ()! 1 within-subject variable: Cnditin (4 levels: viswrd, vispsw, viscstr, audwrd, audpsw)! 1 quantitative (between-subjects) variable: Age (mean age nt significantly different acrss grups)! Tests f interest?! Main effects, interactins, varius cntrasts! Mdel! ˆ ij = 1 x 1j +... + k x kj + i + ij What prgram? 3dMVM, 3dLME!
Overview: learning by 11 examples! BOLD respnses estimated with ne basis functin! 3 grups! 2 cnditins! 2 cnditins with missing data! 3 grups + 2 genders! 3 grups + 2 cnditins! 3 grups + 2 genders + 1 numeric variable (between-subjects)! 3 grups + 2 cnditins + 1 numeric variable (between-subjects)! 3 grups + 2 cnditins + 2 numeric variables (1 within-subject and 1 between-subjects)! BOLD respnses estimated with multiple basis functins! 1 grup! 2 grups! 2 grups + 2 cnditins!