> source("/p/stat/Data/MJ/pothoff.s") Df Sum of Sq Mean Sq F Value Pr(F) agefac 3 237.1921 79.0640 40.03166 0.00000000 sex 1 140.4649 140.4649 71.12008 0.00000000 person 25 377.9148 15.1166 7.65382 0.00000000 agefac:sex 3 13.9925 4.6642 2.36156 0.07805827 Residuals 75 148.1278 1.9750 Error: person Df Sum of Sq Mean Sq F Value Pr(F) sex 1 140.4649 140.4649 9.292099 0.005375056 Residuals 25 377.9148 15.1166 Error: Within Df Sum of Sq Mean Sq F Value Pr(F) agefac 3 237.1921 79.06404 40.03166 0.00000000 agefac:sex 3 13.9925 4.66418 2.36156 0.07805827 Residuals 75 148.1278 1.97504 > pothoff.lme <- lme(fixed=y~agefac*sex,random=~1, + cluster=~person,data=pothoff, + est.method="RML", re.structure="identity") > pothoff.lme Call: Fixed: y ~ agefac * sex Random: ~ 1 Cluster: ~ person Data: pothoff Variance/Covariance Components Estimates: Structure: identity Standard Deviation(s) of Random Effect(s) (Intercept) 1.812562 Cluster Residual Variance: 1.975039 Fixed Effects Estimates: (Intercept) agefac1 agefac2 agefac3 sex agefac1sex agefac2sex 23.80824 0.4957386 0.6268939 0.657197 1.160511 -0.02698864 0.1647727 agefac3sex 0.1761364 Number of Observations: 108 Number of Clusters: 27 > anova(pothoff.lme) Value Std.Error z ratio (Intercept) 23.80823864 0.3807080 62.5367381 agefac1 0.49573864 0.1946115 2.5473250 agefac2 0.62689394 0.1123590 5.5793844 agefac3 0.65719697 0.0794498 8.2718521 sex 1.16051136 0.3807080 3.0482975 agefac1sex -0.02698864 0.1946115 -0.1386796 agefac2sex 0.16477273 0.1123590 1.4664847 agefac3sex 0.17613636 0.0794498 2.2169517 > summary(pothoff.lme) Call: Fixed: y ~ agefac * sex Random: ~ 1 Cluster: ~ person Data: pothoff Estimation Method: RML Convergence at iteration: 3 Restricted Loglikelihood: -220.833 Restricted AIC: 461.6659 Variance/Covariance Components Estimates: Structure: identity Standard Deviation(s) of Random Effect(s) (Intercept) 1.812562 Cluster Residual Variance: 1.975039 Fixed Effects Estimates: Value Approx. Std.Error z ratio(C) (Intercept) 23.80823864 0.3807080 62.5367381 agefac1 0.49573864 0.1946115 2.5473250 agefac2 0.62689394 0.1123590 5.5793844 agefac3 0.65719697 0.0794498 8.2718521 sex 1.16051136 0.3807080 3.0482975 agefac1sex -0.02698864 0.1946115 -0.1386796 agefac2sex 0.16477273 0.1123590 1.4664847 agefac3sex 0.17613636 0.0794498 2.2169517 Conditional Correlations of Fixed Effects Estimates (Intercept) agefac1 agefac2 agefac3 agefac1 0.000000e+00 agefac2 0.000000e+00 -4.532467e-17 agefac3 0.000000e+00 -3.204938e-17 6.409876e-17 sex -1.851852e-01 0.000000e+00 0.000000e+00 0.000000e+00 agefac1sex 0.000000e+00 -1.851852e-01 8.393457e-18 5.935070e-18 agefac2sex 0.000000e+00 1.678691e-17 -1.851852e-01 -1.187014e-17 agefac3sex 0.000000e+00 1.187014e-17 -1.606687e-17 -1.851852e-01 sex agefac1sex agefac2sex agefac1 agefac2 agefac3 sex agefac1sex 0.000000e+00 agefac2sex 0.000000e+00 -9.064933e-17 agefac3sex 0.000000e+00 -6.409876e-17 8.676109e-17 Random Effects (Conditional Modes): (Intercept) 1 -1.10644035 2 0.30624688 3 0.95825637 4 1.93627061 5 -0.01975786 6 -1.32377684 7 0.30624688 8 0.63225163 9 -1.32377684 10 -3.60581006 11 3.24028959 12 2.41786852 13 -1.38552017 14 -0.62484243 15 1.43985429 16 -1.71152491 17 1.22251779 18 -1.05951542 19 -0.95084717 20 0.13583531 21 3.93922400 22 -1.16818367 23 -0.62484243 24 -0.62484243 25 -0.08150119 26 0.78784480 27 -1.71152491 Standardized Cluster Residuals: Min Q1 Med Q3 Max -3.735807 -0.4760685 0.04687492 0.4691106 3.661276 Number of Observations: 108 Number of Clusters: 27 > pothoff.slme <- lme(y~age*sex,random=~age,cluster=~person,data=pothoff, + est.method="RML", re.structure="identity") > pothoff.slme Call: Fixed: y ~ age * sex Random: ~ age Cluster: ~ person Data: pothoff Variance/Covariance Components Estimates: Structure: identity Standard Deviation(s) of Random Effect(s) (Intercept) age 0.1591447 0.1591447 Cluster Residual Variance: 2.002892 Fixed Effects Estimates: (Intercept) age sex age:sex 16.85668 0.6319602 -0.5160511 0.1524148 Number of Observations: 108 Number of Clusters: 27 > anova(pothoff.slme) Value Std.Error z ratio (Intercept) 16.8566761 0.69635386 24.207055 age 0.6319602 0.06936946 9.110064 sex -0.5160511 0.69635386 -0.741076 age:sex 0.1524148 0.06936946 2.197145 Value Std.Error z ratio (Intercept) 16.8566761 0.69635386 24.207055 age 0.6319602 0.06936946 9.110064 sex -0.5160511 0.69635386 -0.741076 age:sex 0.1524148 0.06936946 2.197145 > print(summary(pothoff.slme)) Call: Fixed: y ~ age * sex Random: ~ age Cluster: ~ person Data: pothoff Estimation Method: RML Convergence at iteration: 4 Restricted Loglikelihood: -219.7073 Restricted AIC: 451.4146 Variance/Covariance Components Estimates: Structure: identity Standard Deviation(s) of Random Effect(s) (Intercept) age 0.1591447 0.1591447 Cluster Residual Variance: 2.002892 Fixed Effects Estimates: Value Approx. Std.Error z ratio(C) (Intercept) 16.8566761 0.69635386 24.207055 age 0.6319602 0.06936946 9.110064 sex -0.5160511 0.69635386 -0.741076 age:sex 0.1524148 0.06936946 2.197145 Conditional Correlations of Fixed Effects Estimates (Intercept) age sex age -0.8746071 sex -0.1851852 0.1619643 age:sex 0.1619643 -0.1851852 -0.8746071 Random Effects (Conditional Modes): (Intercept) age 1 -0.008867754 -0.098958311 2 -0.003061591 0.037805716 3 0.002383678 0.095705730 4 0.019066418 0.166477969 5 0.003676702 -0.009008495 6 -0.010998208 -0.117662843 7 0.001668873 0.028873614 8 0.011960250 0.043532258 9 -0.009106023 -0.121235684 10 -0.034787116 -0.311380792 11 0.028064772 0.285850839 12 0.020567370 0.214005429 13 -0.013404253 -0.119576341 14 -0.005474617 -0.055003692 15 0.025644765 0.102145522 16 -0.018019073 -0.144953508 17 0.014053383 0.101305194 18 -0.010681618 -0.090626334 19 -0.001574602 -0.096458642 20 -0.002275445 0.018501060 21 0.039264920 0.337791467 22 -0.002758963 -0.116949593 23 -0.010205081 -0.046071590 24 -0.028180844 -0.012129603 25 0.004108936 -0.016281255 26 0.001277639 0.079973915 27 -0.012342516 -0.155672030 Standardized Cluster Residuals: Min Q1 Med Q3 Max -3.879501 -0.3813434 -0.01120198 0.4596688 3.552156 Number of Observations: 108 Number of Clusters: 27 > Call: + Fixed: y ~ age * sex Call:Fixed:y ~ age * sex Random: ~ age * sex Cluster: ~ person Data: pothoff Variance/Covariance Components Estimates: Structure: identity Standard Deviation(s) of Random Effect(s) (Intercept) age sex age:sex 0.1072115 0.1072115 0.1072115 0.1072115 Cluster Residual Variance: 3.177324 Fixed Effects Estimates: (Intercept) age sex age:sex 16.85668 0.6319602 -0.5160511 0.1524148 Number of Observations: 108 Number of Clusters: 27 > anova(pothoff.lme,pothoff.slme) Response: y pothoff.lme fixed: (Intercept),agefac1,agefac2,agefac3,sex,agefac1sex,agefac2sex,agefac3sex random: (Intercept) block: list(1:1) covariance structure: identity pothoff.slme fixed: (Intercept),age,sex,age:sex random: (Intercept),age block: list(1:2) covariance structure: identity Model Df AIC Loglik Test Lik.Ratio P value pothoff.lme 1 10 461.67 -220.83 pothoff.slme 2 6 451.41 -219.71 1 vs. 2 2.2513 0.68965