Daniel Chi Keung Chim Lap on p*q design: week 6 [i] ? $units 32$ [i] ? $data y$ [i] ? $read [i] $REA? 7.2 9.6 4.2 3.5 9.5 9.3 5.4 3.9 [i] $REA? 8.5 9.6 2.9 3.3 8.8 9.2 6.3 6.0 [i] $REA? 9.1 8.6 1.8 2.4 7.6 7.1 6.1 5.7 [i] $REA? 7.8 8.0 3.7 3.9 9.2 8.3 6.5 6.9 [i] ? $cal patient=%gl(4,2): physician=%gl(4,8)$ [i] ? $factor patient 4 physician 4$ [i] ? $yvar y$ [i] ? $fit$ [o] deviance = 180.44 [o] residual df = 31 [o] [i] ? $fit + patient$ [o] deviance = 20.964 (change = -159.5) [o] residual df = 28 (change = -3 ) [o] [i] ? $fit + physician$ [o] deviance = 17.905 (change = -3.058) [o] residual df = 25 (change = -3 ) [o] [i] ? $fit + patient.physician$ [o] deviance = 6.1150 (change = -11.79) [o] residual df = 16 (change = -9 ) [o] Physicians are the fixed effect and Patients are the random effect Therefore we have got a mixed model. Anova Table Source SS df MS F Patient 159.5 3 53.17 139.92 (=53.17/0.38) sign Physician 3.058 3 1.02 0.7786 (=1.02/1.31) insig Patient.Physician 11.79 9 1.31 3.45 (=1.31/0.38) sign Error 6.115 16 0.38 Total 180.46 31 H_0 There is no significant difference between response times of the physicians H_A There is a significant difference between response times of the physicians F(3,9,0.05) = 3.86 therefore F test of the physicians is 0.7786< 3.86, so accept H_O this concludes that there no significant difference between response times of the physicians [i] ? $tabulate the y mean for physician; patient$ [o] PATIENT 1 2 3 4 [o] PHYSICIA [o] 1 8.400 3.850 9.400 4.650 [o] 2 9.050 3.100 9.000 6.150 [o] 3 8.850 2.100 7.350 5.900 [o] 4 7.900 3.800 8.750 6.700 | |10 | p1 | p2,p3 p2 | p1 p4 | p4 | | p3 p4 | | p2,p3 | |5 | p1 | p1,p4 | | p2 | | p3 | | | ---------------------------------------Patient 1 2 3 4 [i] ? $display e s r m$ [o] estimate s.e. parameter [o] 1 8.400 0.4371 1 [o] 2 -4.550 0.6182 PATIENT(2) [o] 3 1.000 0.6182 PATIENT(3) [o] 4 -3.750 0.6182 PATIENT(4) [o] 5 0.6500 0.6182 PHYSICIA(2) [o] 6 0.4500 0.6182 PHYSICIA(3) [o] 7 -0.5000 0.6182 PHYSICIA(4) [o] 8 -1.400 0.8743 PATIENT(2).PHYSICIA(2) [o] 9 -2.200 0.8743 PATIENT(2).PHYSICIA(3) [o] 10 0.4500 0.8743 PATIENT(2).PHYSICIA(4) [o] 11 -1.050 0.8743 PATIENT(3).PHYSICIA(2) [o] 12 -2.500 0.8743 PATIENT(3).PHYSICIA(3) [o] 13 -0.1500 0.8743 PATIENT(3).PHYSICIA(4) [o] 14 0.8500 0.8743 PATIENT(4).PHYSICIA(2) [o] 15 0.8000 0.8743 PATIENT(4).PHYSICIA(3) [o] 16 2.550 0.8743 PATIENT(4).PHYSICIA(4) [o] scale parameter 0.3822 [o] [o] standard errors of parameter estimate differences [o] 1 0.000 [o] 2 0.9775 0.000 [o] 3 0.9775 0.6182 0.000 [o] 4 0.9775 0.6182 0.6182 0.000 [o] 5 0.9775 0.6182 0.6182 0.6182 0.000 [o] 6 0.9775 0.6182 0.6182 0.6182 0.6182 0.000 [o] 7 0.9775 0.6182 0.6182 0.6182 0.6182 0.6182 [o] 8 0.7572 1.382 1.236 1.236 1.382 1.236 [o] 9 0.7572 1.382 1.236 1.236 1.236 1.382 [o] 10 0.7572 1.382 1.236 1.236 1.236 1.236 [o] 11 0.7572 1.236 1.382 1.236 1.382 1.236 [o] 12 0.7572 1.236 1.382 1.236 1.236 1.382 [o] 13 0.7572 1.236 1.382 1.236 1.236 1.236 [o] 14 0.7572 1.236 1.236 1.382 1.382 1.236 [o] 15 0.7572 1.236 1.236 1.382 1.236 1.382 [o] 16 0.7572 1.236 1.236 1.382 1.236 1.236 [o] 1 2 3 4 5 6 [o] [o] 7 0.000 [o] 8 1.236 0.000 [o] 9 1.236 0.8743 0.000 [o] 10 1.382 0.8743 0.8743 0.000 [o] 11 1.236 0.8743 1.071 1.071 0.000 [o] 12 1.236 1.071 0.8743 1.071 0.8743 0.000 [o] 13 1.382 1.071 1.071 0.8743 0.8743 0.8743 [o] 14 1.236 0.8743 1.071 1.071 0.8743 1.071 [o] 15 1.236 1.071 0.8743 1.071 1.071 0.8743 [o] 16 1.382 1.071 1.071 0.8743 1.071 1.071 [o] 7 8 9 10 11 12 [o] [o] 13 0.000 [o] 14 1.071 0.000 [o] 15 1.071 0.8743 0.000 [o] 16 0.8743 0.8743 0.8743 0.000 [o] 13 14 15 16 [o] [o] unit observed fitted residual [o] 1 7.200 8.400 -1.200 [o] 2 9.600 8.400 1.200 [o] 3 4.200 3.850 0.350 [o] 4 3.500 3.850 -0.350 [o] 5 9.500 9.400 0.100 [o] 6 9.300 9.400 -0.100 [o] 7 5.400 4.650 0.750 [o] 8 3.900 4.650 -0.750 [o] 9 8.500 9.050 -0.550 [o] 10 9.600 9.050 0.550 [o] 11 2.900 3.100 -0.200 [o] 12 3.300 3.100 0.200 [o] 13 8.800 9.000 -0.200 [o] 14 9.200 9.000 0.200 [o] 15 6.300 6.150 0.150 [o] 16 6.000 6.150 -0.150 [o] 17 9.100 8.850 0.250 [o] 18 8.600 8.850 -0.250 [o] 19 1.800 2.100 -0.300 [o] 20 2.400 2.100 0.300 [o] 21 7.600 7.350 0.250 [o] 22 7.100 7.350 -0.250 [o] 23 6.100 5.900 0.200 [o] 24 5.700 5.900 -0.200 [o] 25 7.800 7.900 -0.100 [o] 26 8.000 7.900 0.100 [o] 27 3.700 3.800 -0.100 [o] 28 3.900 3.800 0.100 [o] 29 9.200 8.750 0.450 [o] 30 8.300 8.750 -0.450 [o] 31 6.500 6.700 -0.200 [o] 32 6.900 6.700 0.200 [o] [o] Current model: [o] [o] number of observations in model is 32 [o] [o] y-variate Y [o] weight * [o] offset * [o] [o] [o] probability distribution is NORMAL [o] link function is IDENTITY [o] scale parameter is to be estimated by the mean deviance [o] [o] linear model: [o] terms: 1+PATIENT+PHYSICIA+PATIENT.PHYSICIA [i] ? $ca res=y-%fv$ [i] ? $sort res$ [i] ? $cal pos=%cu(1): pos=(pos-0.5)/%nu: pos=%nd(pos)$ [i] ? $plot pos res$ [o] | [o] 2. + P [o] | P [o] | P P [o] 1. + PP [o] | 2 2 [o] | PP2 [o] 0. + 2 2 [o] | 2PP [o] | 22 [o] -1. + PP [o] | P P [o] | P [o] -2. + P [o] | [o] | [o] -3. + [o] +----------+----------+----------+----------+----------+----- [o] -1.5 -1.0 -0.5 0.0 0.5 1.0 [i] ? $stop It can be established that the physicians are consistent as their response times amongst patients show no significant difference. If physicians were drawn at random and the patients are drawn at random, we have a random effects model. Anova Table Source SS df MS F Patient 159.5 3 53.17 40.588 (=53.17/1.31) sign Physician 3.058 3 1.02 0.7786 (=1.02/1.31) insig Patient.Physician 11.79 9 1.31 3.45 (=1.31/0.38) sign Error 6.115 16 0.38 Total 180.46 31 H_0 There is no significant difference between response times of the physicians H_A There is a signifianct difference between response times of the physicians F(3,9,0.05) = 3.86 therefore F test for physicians is 0.7786 < 3.86, so accept H_O that there no significant difference between response times of the physicians