libname focus "C:\Users\tneilands\Box Sync\My Documents\CAPS\Methods Core\Presentations\Missing Data 2015\Part 1\Example 3"; ods rtf style = journal file = "C:\Users\tneilands\Box Sync\My Documents\CAPS\Methods Core\Presentations\Missing Data 2015\Part 1\Example 3\Duncan.rtf" ; ** --> Display missing data patterns <-- ** ; ods graphics off ; proc mi data = focus.wide_demo nimpute = 0 ; var randstat ln_sumsymarv1 ln_sumsymarv2 ln_sumsymarv3 avgbother0 avgbother3 avgbother6 ; run ; ** --> Perform doubly-mv analyses on the wide data dropping cases with missing data <-- ** ; ods graphics off ; proc glm data = focus.wide_demo ; title "Focus: Doubly-Multivariate Analysis: ARV symptoms and bother" ; title2 "Cases with missing data excluded (GLM method)" ; class randstat ; model ln_sumsymarv1 ln_sumsymarv2 ln_sumsymarv3 avgbother0 avgbother3 avgbother6 = randstat / nouni ; repeated measure 2, time 3 ; run ; quit ; ** --> Tranpose data to long format required by PROC MIXED <-- ** ; data focus.dmv_demo ; set focus.wide_demo ; array mvar(2,3) ln_sumsymarv1 ln_sumsymarv2 ln_sumsymarv3 avgbother0 avgbother3 avgbother6 ; do measure = 1 to 2 ; do time = 1 to 3 ; arv_sym_both = mvar(measure, time) ; output ; end ; end ; keep arv_sym_both subject randstat measure time ; run ; ** --> Perform doubly-mv analyses on the long data excluding cases with missing data <-- ** ; ods graphics off ; proc mixed data = focus.dmv_demo ; title "Focus: Doubly-Multivariate Analysis: ARV symptoms and bother" ; title2 "Cases with missing data excluded" ; where subject not in (7, 8, 31, 40, 43, 46, 77, 80, 82, 99, 172, 217, 247, 290) ; class measure randstat time subject ; model arv_sym_both = randstat|measure|time ; repeated measure time / subject = subject type = un@un ; run ; ** --> Perform doubly-mv analyses on the long data retaining cases with missing data <-- ** ; ods graphics off ; proc mixed data = focus.dmv_demo ; title "Focus: Doubly-Multivariate Analysis: ARV symptoms and bother" ; title2 "All cases" ; class measure randstat time subject ; model arv_sym_both = randstat|measure|time / solution ; repeated measure time / subject = subject type = un@un ; lsmeans measure*randstat*time ; slice measure*randstat*time / sliceby = measure*time diff noF ; run ; ods rtf close ; ods graphics on ;