[R-sig-ME] problem fitting a mixed model due to between subject variation

R.Donders at ebh.umcn.nl R.Donders at ebh.umcn.nl
Tue Jul 27 16:00:39 CEST 2010


Dear all,

I have a problem with an mixed analysis. All though residual plots and a
fixed analysis suggest that (at least) 
a random intercept should be incorporated in the model, I keep getting a
zero variance (or almost zero variance) for the random intercept, 
I guess because of the huge between subject differences. The data and
some commands for visualizing and analyzing 
the data are given below. These are performed using package nlme, but I
found identical results for packages lme4 and lmm, 
and also for SAS, SPSS and MlWin.
I could use the fixed analysis, but I rather would like not to do that,
since that implies that the number of parameters 
increases with the number of subjects. I could center all predictor
scores around the subject means, but that would 
(almost) be the same so I also would not want to do that. Does anybody
have a suggestion how to proceed?

Best regards
Rogier

_______________________________________________________

Rogier Donders, PhD, Biostatistician
Department of Epidemiology, Biostatistics and HTA, EBH 133
Radboud University Nijmegen Medical Centre
P.O. Box 9101
6500 HB Nijmegen
The Netherlands
_______________________________________________________


strangedat <- 
structure(list(subject = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 
5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 
8L, 8L, 8L, 8L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 10L, 11L, 11L, 
11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 13L, 13L, 13L, 13L, 14L, 
14L, 14L, 14L, 14L, 14L, 15L, 15L, 15L, 15L, 15L, 15L, 16L, 16L, 
16L, 16L, 16L, 16L, 17L, 17L, 17L, 17L, 17L, 17L, 18L, 18L, 18L, 
19L, 19L, 19L, 19L, 19L, 19L, 20L, 20L, 20L, 20L, 20L, 20L, 21L, 
21L, 21L, 21L, 22L, 22L, 22L, 22L, 22L, 22L, 23L, 23L, 23L, 23L, 
23L, 24L, 24L, 24L, 24L, 24L, 24L, 25L, 25L, 25L, 25L, 25L, 25L, 
26L, 26L, 26L, 27L, 27L, 27L, 27L, 27L, 27L, 28L, 28L, 28L, 28L, 
28L, 28L, 29L, 29L, 29L, 29L, 29L, 30L, 30L, 30L, 30L, 30L, 30L, 
31L, 31L, 31L, 31L, 32L, 32L, 32L, 32L, 32L, 32L, 33L, 33L, 33L, 
33L, 33L, 33L, 34L, 34L, 34L, 34L, 34L, 34L, 35L, 35L, 35L, 35L, 
35L, 35L, 36L, 36L, 36L, 36L, 36L, 37L, 37L, 37L, 37L, 37L, 37L, 
38L, 38L, 38L, 38L, 38L, 38L, 39L, 39L, 39L, 39L, 39L, 40L, 40L, 
40L, 40L, 40L, 41L, 41L, 41L, 41L, 41L, 42L, 42L, 42L, 42L, 43L, 
43L, 43L, 43L, 43L, 43L, 44L, 44L, 44L, 44L, 44L, 44L, 45L, 45L, 
45L, 45L, 45L, 45L, 46L, 46L, 46L, 46L, 47L, 47L, 47L, 47L, 47L, 
47L, 48L, 48L, 48L, 48L, 48L, 48L, 49L, 49L, 49L, 50L, 50L, 50L, 
50L, 50L, 51L, 51L, 51L, 51L, 51L, 51L, 52L, 52L, 52L, 52L, 52L, 
52L, 53L, 53L, 53L, 53L, 53L, 53L, 54L, 54L, 54L, 54L, 54L, 54L, 
55L, 55L, 55L, 56L, 56L, 56L, 56L, 56L, 56L, 57L, 57L, 57L, 57L, 
57L, 58L, 58L, 58L, 58L, 58L, 58L, 59L, 59L, 59L, 59L, 60L, 60L, 
60L, 60L, 60L, 60L, 61L, 61L, 61L, 61L, 62L, 62L, 62L, 62L, 62L, 
62L, 63L, 63L, 63L, 63L, 63L, 64L, 64L, 64L, 64L, 64L, 65L, 65L, 
65L, 65L, 65L, 65L, 66L, 66L, 66L, 66L, 66L, 66L, 67L, 67L, 67L, 
67L, 67L, 67L, 68L, 68L, 68L, 68L, 69L, 69L, 69L, 69L, 69L, 69L, 
70L, 70L, 70L, 70L, 70L, 70L, 71L, 71L, 71L, 71L, 71L, 72L, 72L, 
72L, 72L, 72L, 73L, 73L, 73L, 73L, 73L, 73L, 74L, 74L, 74L, 74L, 
74L, 75L, 75L, 75L, 76L, 76L, 76L, 76L, 76L, 76L, 77L, 77L, 77L, 
77L, 77L, 77L, 78L, 78L, 78L, 78L, 78L, 79L, 79L, 79L, 80L, 80L, 
80L), .Label = c("5002", "5004", "5005", "5008", "5009", "5010", 
"5012", "5013", "5014", "5016", "5019", "5022", "5023", "5025", 
"5026", "5027", "5028", "5030", "5031", "5032", "5033", "5034", 
"5035", "5038", "5041", "5042", "5044", "5045", "5046", "5051", 
"5052", "5053", "5056", "5060", "5061", "5062", "5064", "5066", 
"5067", "5069", "5072", "5073", "5075", "5077", "5078", "5079", 
"5080", "5081", "5084", "5087", "5089", "5090", "5092", "5093", 
"5095", "5096", "5097", "5098", "5100", "5102", "5103", "5104", 
"5105", "5107", "5108", "5109", "5110", "5111", "5112", "5114", 
"5117", "5118", "5119", "5120", "5121", "5122", "5123", "5124", 
"5126", "5128"), class = "factor"), outcome = c(1.04380405217311, 
2.08193842187842, 2.94391252482419, 2.10046890887191, 2.11142458753289, 
2.05284085988266, 1.59736533119983, 2.12226153886276, 2.31451366385932, 
3.85418200573830, 3.54961738678043, 3.56189799235315, 3.67630067190708, 
3.40319538432483, 3.46291944029015, 3.17680304844629, 2.99322914333587, 
3.18387021566939, 2.96578839718092, 2.85819285953193, 2.91831112658541, 
1.81482474215905, 2.00955541421567, 2.00955541421567, 2.51365606307399, 
2.59076704048748, 2.10413415427021, 1.95302761682418, 2.40423874672055, 
1.72276659774110, 1.72455071953461, 1.74221902366792, 1.49514876603197, 
1.70837786028900, 2.12226153886276, 1.49514876603197, 4.65965837127216, 
3.98210861299483, 3.62886402170395, 4.39321382406445, 3.52164353473802, 
3.05400118167797, 2.81899509505394, 3.39618483983861, 3.37861088298936, 
3.26575941076705, 3.36970671457078, 3.19335286763712, 3.14544454678232, 
3.2557861788883, 6.43268282492196, 5.34843997595125, 4.18128649235591, 
4.19283150893675, 4.86236727742715, 3.1776370768516, 1.22671229129543, 
2.40423874672055, 1.74221902366792, 1.34807314829969, 6.64395898965631, 
6.65780563324742, 6.42285727722606, 7.00471863698859, 3.71503441159079, 
3.97724879034585, 4.41170678877529, 4.06302587896467, 3.93123722435195, 
3.80176161117061, 4.20886301566469, 4.22566517954946, 4.04847512856365, 
3.86094021519883, 3.95393240850536, 3.95393240850536, 1.41827740697294, 
1.48839958405704, 1.10525683138678, 1.10525683138678, 1.30562645805244, 
1.02961941718116, 4.5913754749659, 4.54063166485052, 4.60936139060656, 
4.51688527112052, 4.34211568336104, 4.24175831411093, 3.08694315360738, 
3.13375357145137, 2.96681826338935, 2.50552593699074, 2.74855214441154, 
2.67000213346468, 2.65112705370259, 2.59823533509500, 3.30468648128131, 
1.31103187661934, 1.08856195281461, 1.20597080698861, 1.32972400963150, 
1.38629436111989, 1.42310833424261, 0.451075619360217,
0.871293365943419, 
0.215111379616945, 0.570979546585738, 5.70501504805875,
5.48910300175412, 
5.60326207855065, 5.23409879422139, 5.85878993020344, 5.47629617390785, 
2.79177841663292, 3.35898553285285, 2.40423874672055, 2.66792241001143, 
2.52492832413749, 3.3579418729912, 3.29212628660779, 2.84024737071360, 
2.94391252482419, 3.04974686186023, 2.65675690671466, 1.86717610851281, 
2.06812778177956, 1.55180879959746, 2.06812778177956, 1.88858365386359, 
1.84371920815877, 2.76443053453832, 3.1302631665116, 3.21124679770371, 
2.39789527279837, 3.3098128198603, 3.95393240850536, 3.84481425573470, 
3.10234200861225, 1.70110510095992, 2.00417905717929, 2.13416644136908, 
2.52011290552262, 2.35991015961332, 2.38508631450579, 2.38508631450579, 
4.9928107091837, 6.24999454709245, 5.49100171037754, 5.33262217024003, 
5.29796730528374, 3.20599319903719, 3.04974686186023, 3.66073714816766, 
2.41054223449914, 3.65169666298622, 3.1540172525197, 4.19283150893675, 
4.1292289640756, 4.52482743330555, 3.02042488614436, 3.0996417369445, 
2.93279247378012, 2.77757626375082, 2.68239045432163, 2.92316158071916, 
2.21920348405499, 1.56861591791385, 0.970778917158225, 1.23256026117785,

0.65232518603969, 1.26129787094521, 1.17557332980424, 2.27109442590267, 
2.1701959049483, 2.45272775142377, 2.65675690671466, 3.47165584531072, 
2.32630161961136, 1.07840958135059, 0.708035793053696, 1.23256026117785,

1.07840958135059, 1.11185751541813, 1.14422279992016, 1.34286480319255, 
1.94448055624572, 0.802001585472027, 0.802001585472027, 2.2321626286975,

0.887891257352457, 0.476234178996372, 0.157003748809665,
0.476234178996372, 
0, 1.43983512804792, 0.887891257352457, 0.802001585472027,
0.598836501088704, 
0.598836501088704, 0.887891257352457, 1.11185751541813,
2.06812778177956, 
2.59972232421658, 2.30657711426358, 2.1770218700187, 2.23964529322017, 
2.13771044980381, 0.598836501088704, 3.04594998971461,
0.476234178996372, 
1.62727783056243, 0.708035793053696, 1.04380405217311,
0.970778917158225, 
1.23256026117785, 1.14422279992016, 0.157003748809665,
0.476234178996372, 
0.598836501088704, 0, 3.73862154600875, 3.55363230470591,
3.3456846717319, 
3.1302631665116, 2.88088243187505, 3.76838355522654, 1.81482474215905, 
1.04380405217311, 1.82937633279936, 0.536493370514568,
0.476234178996372, 
1.71739505393919, 2.21156569460688, 2.03339760317843, 2.27109442590267, 
2.10413415427021, 3.09467222140889, 2.07065303564676, 5.20499520931666, 
4.0095126267054, 3.56359963768718, 4.83055123224249, 0, 0,
0.246860077931526, 
0, 0.157003748809665, 0.708035793053696, 2.70604819843154,
2.71204222237175, 
2.6440448711263, 2.76443053453832, 2.99822915375258, 3.02042488614436, 
1.80828877117927, 1.62924053973028, 2.77508560243837, 0.476234178996372,

0.476234178996372, 1.04380405217311, 1.17557332980424,
0.756121979721334, 
2.7868613815265, 2.91560622907471, 2.79239134953596, 2.7239235502585, 
2.39607543608138, 2.7239235502585, 1.98375629154543, 2.37861977927004, 
2.21156569460688, 2.35327820730956, 2.10413415427021, 2.10413415427021, 
0.598836501088704, 0.157003748809665, 0, 0.157003748809665, 0, 
0.157003748809665, 0.329303747142600, 0.802001585472027,
0.476234178996372, 
0.598836501088704, 0.476234178996372, 0.405465108108164,
4.17392562489244, 
4.18113369229449, 4.12632760807515, 0.708035793053696, 1.07840958135059,

0.887891257352457, 1.56861591791385, 0.802001585472027,
0.157003748809665, 
1.62924053973028, 1.56234630490025, 1.52605630349505, 1.73695123273306, 
1.62924053973028, 3.55019193434004, 4.19750265432473, 4.36995405343961, 
4.22171115814254, 4.32307249183021, 4.00787849107167, 2.71800053195538, 
2.44408465526775, 2.41233595695316, 2.28949985344539, 1.11185751541813, 
1.31640823365572, 1.34286480319255, 0.708035793053696,
0.405465108108164, 
1.81482474215905, 2.70604819843154, 2.98517675961447, 3.80488312987024, 
3.07083974604080, 1.69193913394584, 2.12942147398486, 1.80828877117927, 
2.19499988231411, 1.88555334851442, 2.47148362945586, 4.41012806478476, 
3.10458667846607, 2.25654115449264, 2.52492832413749, 2.08939187253300, 
2.56878813376870, 1.70837786028900, 1.5953389880546, 1.62924053973028, 
2.71336936257981, 3.41969196429832, 3.4626060097908, 1.17865499634165, 
3.70105503004407, 3.90499839049118, 3.65325227647079, 3.24102862950933, 
3.27487801498349, 1.62924053973028, 1.72276659774110, 1.48839958405704, 
1.89911798754855, 1.25561603747777, 1.5953389880546, 1.72276659774110, 
1.17865499634165, 1.32441895740180, 1.00795792039998, 0.157003748809665,

0.329303747142600, 1.26129787094521, 0, 2.33891702224144,
1.69193913394584, 
1.27815220250019, 1.12492959698548, 1.66203036255327, 1.66203036255327, 
2.20386912005489, 1.56234630490025, 0.90825856017689, 1.91102289005487, 
1.88555334851442, 1.44926916028128, 3.17805383034795, 2.89037175789616, 
2.99573227355399, 3.43398720448515, 3.13549421592915, 4.60517018598809, 
4.91998092582813, 4.47733681447821, 4.39444915467244, 4.65396035015752, 
2.56494935746154, 2.19722457733622, 2.56494935746154, 2.30258509299405, 
2.39789527279837, 1.6094379124341, 2.89037175789616, 2.77258872223978, 
2.77258872223978, 2.63905732961526, 2.83321334405622, 1.94591014905531, 
3.73766961828337, 1.94591014905531, 4.02535169073515, 3.78418963391826, 
2.07944154167984, 3.87120101090789, 4.04305126783455, 3.76120011569356, 
2.07944154167984, 1.94591014905531, 3.52636052461616, 3.87120101090789, 
3.46573590279973, 3.17805383034795, 1.6094379124341, 1.6094379124341, 
1.38629436111989, 1.38629436111989, 0, 4.82398437914107,
4.00642368084963, 
4.9608145991123, 1.17865499634165, 1.98237982883670, 1.36863942588117
), pred = c(1.28923264827676, 1.04380405217311, 2.08193842187842, 
2.287471455184, 2.10046890887191, 2.11142458753289, 2.05284085988266, 
1.59736533119983, 2.12226153886276, 3.96100362764977, 3.85418200573830, 
3.54961738678043, 3.56189799235315, 3.67630067190708, 3.40319538432483, 
3.16547504814109, 3.17680304844629, 2.99322914333587, 3.18387021566939, 
2.96578839718092, 2.85819285953193, 1.71739505393919, 1.81482474215905, 
2.00955541421567, 2.80940269536250, 2.51365606307399, 2.59076704048748, 
2.10413415427021, 1.95302761682418, 2.40423874672055, 1.83736998048011, 
1.72455071953461, 1.74221902366792, 1.49514876603197, 1.70837786028900, 
2.12226153886276, 4.05421677113132, 4.65965837127216, 3.98210861299483, 
3.62886402170395, 4.39321382406445, 3.52164353473802, 2.88088243187505, 
2.81899509505394, 3.39618483983861, 3.38167471517329, 3.26575941076705, 
3.36970671457078, 3.19335286763712, 3.14544454678232, 4.62045280951925, 
6.43268282492196, 5.34843997595125, 4.18128649235591, 4.19283150893675, 
4.86236727742715, 1.31103187661934, 1.22671229129543, 2.40423874672055, 
1.74221902366792, 6.17213891469703, 6.64395898965631, 6.65780563324742, 
6.42285727722606, 5.26806432337702, 3.71503441159079, 3.97724879034585, 
4.41170678877529, 4.06302587896467, 3.93123722435195, 4.35014889577586, 
4.20886301566469, 4.22566517954946, 4.04847512856365, 3.86094021519883, 
3.95393240850536, 1.17865499634165, 1.41827740697294, 1.48839958405704, 
1.10525683138678, 1.10525683138678, 1.30562645805244, 4.51502663613513, 
4.5913754749659, 4.54063166485052, 4.60936139060656, 4.51688527112052, 
4.34211568336104, 2.83497649467460, 3.08694315360738, 3.13375357145137, 
2.82137888640921, 2.50552593699074, 2.74855214441154, 2.67000213346468, 
2.65112705370259, 2.59823533509500, 2.0906287310704, 1.31103187661934, 
1.08856195281461, 1.20597080698861, 1.32972400963150, 1.38629436111989, 
0.871293365943419, 0.451075619360217, 0.871293365943419,
0.215111379616945, 
6.44489408173266, 5.70501504805875, 5.48910300175412, 5.60326207855065, 
5.23409879422139, 5.85878993020344, 2.85070650150373, 2.79177841663292, 
3.35898553285285, 2.40423874672055, 2.66792241001143, 3.14931136148229, 
3.3579418729912, 3.29212628660779, 2.84024737071360, 2.94391252482419, 
3.04974686186023, 2.07819075977818, 1.86717610851281, 2.06812778177956, 
1.55180879959746, 2.06812778177956, 1.88858365386359, 3.86157146193205, 
2.76443053453832, 3.1302631665116, 5.06474461974329, 2.39789527279837, 
3.3098128198603, 3.95393240850536, 3.84481425573470, 3.10234200861225, 
2.02814824729229, 2.00417905717929, 2.13416644136908, 2.52011290552262, 
2.35991015961332, 2.38508631450579, 5.57135523413609, 4.9928107091837, 
6.24999454709245, 5.49100171037754, 5.33262217024003, 2.90853906185161, 
3.20599319903719, 3.04974686186023, 3.66073714816766, 2.41054223449914, 
3.65169666298622, 5.04838056033851, 4.19283150893675, 4.1292289640756, 
4.52482743330555, 2.67000213346468, 3.0996417369445, 2.93279247378012, 
2.77757626375082, 2.68239045432163, 2.92316158071916, 1.56861591791385, 
1.56861591791385, 0.970778917158225, 1.23256026117785, 0.65232518603969,

1.26129787094521, 1.99605993274078, 2.27109442590267, 2.1701959049483, 
2.45272775142377, 2.65675690671466, 3.47165584531072, 1.39128190263093, 
1.07840958135059, 0.708035793053696, 1.23256026117785, 1.07840958135059,

1.11185751541813, 0, 1.34286480319255, 1.94448055624572,
0.802001585472027, 
0.802001585472027, 1.39128190263093, 0.887891257352457,
0.476234178996372, 
0.157003748809665, 0.476234178996372, 0, 1.07840958135059,
0.887891257352457, 
0.802001585472027, 0.598836501088704, 0.598836501088704,
0.887891257352457, 
2.70203212877665, 2.06812778177956, 2.59972232421658, 2.30657711426358, 
2.1770218700187, 0.932164081030445, 2.13771044980381, 0.598836501088704,

3.04594998971461, 0.476234178996372, 0.887891257352457,
0.708035793053696, 
1.04380405217311, 0.970778917158225, 1.23256026117785, 0.65232518603969,

0.157003748809665, 0.476234178996372, 0.598836501088704,
4.11577984294217, 
3.73862154600875, 3.55363230470591, 3.3456846717319, 3.1302631665116, 
2.88088243187505, 1.04380405217311, 1.81482474215905, 1.04380405217311, 
1.82937633279936, 0.536493370514568, 0.476234178996372,
2.25129179860650, 
2.21156569460688, 2.03339760317843, 2.27109442590267, 2.10413415427021, 
3.09467222140889, 6.0498277904049, 5.20499520931666, 4.0095126267054, 
3.56359963768718, 0.476234178996372, 0, 0, 0.246860077931526, 
0, 0.157003748809665, 2.46044317760963, 2.70604819843154,
2.71204222237175, 
2.6440448711263, 2.76443053453832, 2.99822915375258, 2.53131302260216, 
1.80828877117927, 1.62924053973028, 0, 0.476234178996372,
0.476234178996372, 
1.04380405217311, 1.17557332980424, 3.08694315360738, 2.7868613815265, 
2.91560622907471, 2.79239134953596, 2.7239235502585, 2.39607543608138, 
1.97129938306013, 1.98375629154543, 2.37861977927004, 2.21156569460688, 
2.35327820730956, 2.10413415427021, 1.56861591791385, 0.598836501088704,

0.157003748809665, 0, 0.157003748809665, 0, 1.52822785700856, 
0.329303747142600, 0.802001585472027, 0.476234178996372,
0.598836501088704, 
0.476234178996372, 4.25632167829882, 4.17392562489244, 4.18113369229449,

0.598836501088704, 0.708035793053696, 1.07840958135059,
0.887891257352457, 
1.56861591791385, 0.802001585472027, 1.52605630349505, 1.62924053973028,

1.56234630490025, 1.52605630349505, 1.73695123273306, 3.70868208141012, 
3.55019193434004, 4.19750265432473, 4.36995405343961, 4.22171115814254, 
4.32307249183021, 2.68784749378469, 2.71800053195538, 2.44408465526775, 
2.41233595695316, 1.98375629154543, 1.11185751541813, 1.31640823365572, 
1.34286480319255, 0.708035793053696, 0.405465108108164,
2.67552700939665, 
2.70604819843154, 2.98517675961447, 3.80488312987024, 2.04769284336526, 
1.69193913394584, 2.12942147398486, 1.80828877117927, 2.19499988231411, 
1.88555334851442, 2.73436750941958, 4.41012806478476, 3.10458667846607, 
2.25654115449264, 2.52492832413749, 2.55022611590864, 2.56878813376870, 
1.70837786028900, 1.5953389880546, 1.62924053973028, 3.35550242240003, 
3.41969196429832, 3.4626060097908, 1.17865499634165, 3.70105503004407, 
3.90499839049118, 2.10900034392138, 3.24102862950933, 3.27487801498349, 
1.62924053973028, 1.72276659774110, 1.48839958405704, 1.72276659774110, 
1.25561603747777, 1.5953389880546, 1.72276659774110, 1.17865499634165, 
1.32441895740180, 0.0487901641694320, 0.157003748809665,
0.329303747142600, 
1.26129787094521, 2.29857707159651, 2.33891702224144, 1.69193913394584, 
1.27815220250019, 1.12492959698548, 1.66203036255327, 1.78002421300963, 
2.20386912005489, 1.56234630490025, 0.90825856017689, 1.91102289005487, 
1.88555334851442, 3.49650756146648, 3.17805383034795, 2.89037175789616, 
2.99573227355399, 3.43398720448515, 4.07753744390572, 4.60517018598809, 
4.91998092582813, 4.47733681447821, 4.39444915467244, 2.07944154167984, 
2.56494935746154, 2.19722457733622, 2.56494935746154, 2.30258509299405, 
2.39789527279837, 2.94443897916644, 2.89037175789616, 2.77258872223978, 
2.77258872223978, 2.63905732961526, 2.07944154167984, 1.94591014905531, 
3.73766961828337, 3.66356164612965, 4.02535169073515, 3.78418963391826, 
2.07944154167984, 3.87120101090789, 4.04305126783455, 1.94591014905531, 
2.07944154167984, 1.94591014905531, 3.52636052461616, 3.87120101090789, 
3.46573590279973, 1.79175946922805, 1.6094379124341, 1.6094379124341, 
1.38629436111989, 1.38629436111989, 4.24305188238329, 4.82398437914107, 
4.00642368084963, 1.30019166206648, 1.17865499634165, 1.98237982883670
)), .Names = c("subject", "outcome", "pred"), row.names = c(2L, 
3L, 4L, 9L, 10L, 11L, 12L, 13L, 14L, 16L, 17L, 18L, 19L, 20L, 
21L, 23L, 24L, 25L, 26L, 27L, 28L, 33L, 34L, 35L, 37L, 38L, 39L, 
40L, 41L, 42L, 44L, 45L, 46L, 47L, 48L, 49L, 51L, 52L, 53L, 54L, 
55L, 56L, 58L, 59L, 60L, 66L, 67L, 68L, 69L, 70L, 72L, 73L, 74L, 
75L, 76L, 77L, 81L, 82L, 83L, 84L, 88L, 89L, 90L, 91L, 93L, 94L, 
95L, 96L, 97L, 98L, 100L, 101L, 102L, 103L, 104L, 105L, 107L, 
108L, 109L, 110L, 111L, 112L, 114L, 115L, 116L, 117L, 118L, 119L, 
121L, 122L, 123L, 128L, 129L, 130L, 131L, 132L, 133L, 135L, 136L, 
137L, 138L, 139L, 140L, 142L, 143L, 144L, 145L, 149L, 150L, 151L, 
152L, 153L, 154L, 156L, 157L, 158L, 159L, 160L, 163L, 164L, 165L, 
166L, 167L, 168L, 170L, 171L, 172L, 173L, 174L, 175L, 177L, 178L, 
179L, 184L, 185L, 186L, 187L, 188L, 189L, 191L, 192L, 193L, 194L, 
195L, 196L, 198L, 199L, 200L, 201L, 202L, 205L, 206L, 207L, 208L, 
209L, 210L, 212L, 213L, 214L, 215L, 219L, 220L, 221L, 222L, 223L, 
224L, 226L, 227L, 228L, 229L, 230L, 231L, 233L, 234L, 235L, 236L, 
237L, 238L, 240L, 241L, 242L, 243L, 244L, 245L, 247L, 248L, 249L, 
250L, 251L, 254L, 255L, 256L, 257L, 258L, 259L, 261L, 262L, 263L, 
264L, 265L, 266L, 268L, 269L, 270L, 271L, 272L, 275L, 276L, 277L, 
278L, 279L, 282L, 283L, 284L, 285L, 286L, 291L, 292L, 293L, 294L, 
296L, 297L, 298L, 299L, 300L, 301L, 303L, 304L, 305L, 306L, 307L, 
308L, 310L, 311L, 312L, 313L, 314L, 315L, 319L, 320L, 321L, 322L, 
324L, 325L, 326L, 327L, 328L, 329L, 331L, 332L, 333L, 334L, 335L, 
336L, 338L, 339L, 340L, 345L, 346L, 347L, 348L, 349L, 352L, 353L, 
354L, 355L, 356L, 357L, 359L, 360L, 361L, 362L, 363L, 364L, 366L, 
367L, 368L, 369L, 370L, 371L, 373L, 374L, 375L, 376L, 377L, 378L, 
382L, 383L, 384L, 387L, 388L, 389L, 390L, 391L, 392L, 394L, 395L, 
396L, 397L, 398L, 401L, 402L, 403L, 404L, 405L, 406L, 410L, 411L, 
412L, 413L, 415L, 416L, 417L, 418L, 419L, 420L, 422L, 423L, 424L, 
425L, 429L, 430L, 431L, 432L, 433L, 434L, 436L, 437L, 438L, 439L, 
440L, 444L, 445L, 446L, 447L, 448L, 450L, 451L, 452L, 453L, 454L, 
455L, 457L, 458L, 459L, 460L, 461L, 462L, 464L, 465L, 466L, 467L, 
468L, 469L, 471L, 472L, 473L, 474L, 478L, 479L, 480L, 481L, 482L, 
483L, 485L, 486L, 487L, 488L, 489L, 490L, 492L, 493L, 494L, 495L, 
496L, 499L, 500L, 501L, 502L, 503L, 506L, 507L, 508L, 509L, 510L, 
511L, 514L, 515L, 516L, 517L, 518L, 522L, 523L, 524L, 527L, 528L, 
529L, 530L, 531L, 532L, 534L, 535L, 536L, 537L, 538L, 539L, 541L, 
542L, 543L, 544L, 545L, 548L, 549L, 550L, 555L, 556L, 557L), class =
"data.frame")

require(nlme)
require(lattice)

xyplot(outcome ~ pred, data = strangedat, type = c('p','r'))

# Note a clear positive relation over subjects

xyplot(outcome ~ pred|subject, data = strangedat, type = c('p','r'))

# Note that within subjects there does not appear to be a relation

# fixed effect models confirm this
fixedmod1 <- lm(outcome ~ pred, data = strangedat)
summary(fixedmod1)

fixedmod2 <- lm(outcome ~ pred + subject, data = strangedat)
summary(fixedmod2)
# Note that the effect for pred has now disappeared 


anova(fixedmod1, fixedmod2)
# and the model with the individual intercepts fits better

randommod <- lme(outcome ~ pred, data = strangedat, random = ~
1|subject)
summary(randommod)
# but almost no variation for the random intercept

plot(randommod,resid(.) ~ pred|subject, type = c('p','r'))
# however it is clear that the residuals do NOT behave correctly


Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629.
The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.




More information about the R-sig-mixed-models mailing list