Developing a Mixed Effects Model Using SAS PROC MIXED Lauren Ackerman Katherine Morgan Rai Oshima
Purpose of the Pilot Study How accurately can participants identify gender from a handwriting sample? 2. Does accuracy improve with feedback?
Demographic Information Group Feedback n = 13 No Feedback n=13 Waves Wave 1 n = 21 Wave 2 n = 25 Wave 3 n = 24 Demographics Age Mean = 26.42 Std Dev = 5.07 Min = 17 Max = 40 Gender M = 8 F = 18 Dominant Hand R = 23 L = 1 Missing = 2 Satisfaction Y = 20 N = 4 Predict Y = 15 N = 9 Missing Data!!!
Writing Samples 1. 2. 3. 4. 5. 6. 1 – F 2 – M 3 – F 4 – F 5 – M 6 – F
Why SAS: PROC SGPANEL Visualize change over time for each subject proc sgpanel data = data_long; title 'Empirical Growth Plots of Score for Participants'; label score = 'Score (# Correct out of 44)’ time = 'Time’; panelby id / columns = 3 rows = 5; reg y = score x = time; run;
PROC SGPLOT proc sgplot data = data_long noautolegend; title 'OLS Trajectories Across Participants'; yaxis min=0 max=50; reg x = time y = score / group = id nomarkers lineattrs = (color = gray pattern = 1 thickness=1); reg x = time y = score / nomarkers lineattrs = (color = red pattern = 1 thickness=3); run; quit;
OLS Assumptions Normality Homoscedasticity Zero Correlation
Why PROC MIXED?
Modeling Covariance Structure Unstructured Covariance Model Independence Covariance Model Compound Symmetry Covariance Model
Missing Data PROC REG vs. PROC MIXED MAR Missing At Random
proc mixed data = hand_long method=ml; model score = time / solution; run; proc reg data = hand_long; model score = time; run; quit;
General Multilevel Model
Independence vs. Multilevel Model
Unconditional Growth Model PROC MIXED Output PROC REG Output
Covariances and Correlations Correlation Matrix
Multilevel Model with Group
Fixed Effects Model Analysis Parameter Model A Model B Model C Model D Model E Model F Initial Status Π0i Intercept γ00 31.0695 (0.6917)*** 29.2597 (0.8362)*** 30.2060 (0.7767)*** 30.1538 (0.7893)*** 32.3241 (1.3379)*** 32.1517 (1.1584)*** Happy (N = 1) γ01 -5.3523 (1.9405)* -4.4149 (1.7057)* -4.5501 (1.4950)** -4.5436 (1.4948)** Centered Age (Age – 17) γ02 -0.2769 (0.1360) -0.2568 (0.1112)* Rate of Change Π1i γ10 1.7341 (0.5303)** 1.5964 (0.5696)* 1.6681 (0.5295)** 1.4907 (0.9542) 1.6977 (0.5090)** γ11 1.2414 (1.4141) γ12 0.02611 (0.1018) Variance Components Level 1 Within Person σε 15.0951 (3.2023)*** 12.1240 (2.5832)*** 11.6501 (2.4676)*** 12.1747 (2.6187)*** 11.0328 (2.2713)*** 11.0500 (2.2724)*** Level 2 In Initial Status σ0 6.6775 (3.6172)* 5.6867 (5.9618) 0.5907 (4.1543) 0.9881 (4.8273) Rate of Change σ1 Covariance σ01 1.0373 (3.0032) 2.0230 (2.2735) 2.3530 (3.1340) 1.8423 (1.3173) 1.8375 (1.3107) Ry,y 0.0930 0.2643 0.2037 0.2862 0.2857 Rε 0.1968 0.2282 0.1935 0.2691 0.2678 R0 0.1484 0.9115 0.8520 1.0000 Deviance 408.9 399.0 387.7 393.0 365.9 366.0 AIC 414.9 409.0 405.7 407.0 379.9 378.0 BIC 418.6 415.3 417.0 415.8 388.2 385.1 2 2 2 2 2 2
Final Model Model F provided the best deviance statistic Satisfaction with handwriting and age were the only significant predictors for intercept No significant predictor for slope besides time
Fit Statistics for Covariance Models Independence Standard Unstructured Compound Symmetry Heterogeneous First-Order Autoregressive Toeplitz -2RLL 369.1 366.5 364.6 365.3 368.2 357.3 AIC 371.1 370.5 368.6 373.3 373.1 376.2 363.3 AICC 372.2 370.7 368.8 374.0 376.9 363.7 BIC 373.2 372.9 371.0 378.0 375.4 380.9 366.8 Deviance Statistics
Pilot Study Results How accurately can participants identify gender from a handwriting sample? Baseline 69.91% accuracy; 95% CI (65.60%,74.23%) Time important predictor (Estimate 1.73, p<0.01) 2. Does accuracy improve with feedback? Group not significant (Estimate 0.37, p = 0.79)
Conclusion Why SAS? Why PROC MIXED? Graphical and mixed effects modeling capability Why PROC MIXED? Allows autocorrelation and homoscedasticity Flexibility in modeling the within subject variability Handles missing data Inclusion of time-varying predictors