data table77 ; input day run glucose @@ ; cards ; 1 1 42.5 1 1 43.3 1 1 42.9 1 2 42.2 1 2 41.4 1 2 41.8 2 3 48.0 2 3 44.6 2 3 43.7 2 4 42.0 2 4 42.8 2 4 42.8 3 5 41.7 3 5 43.4 3 5 42.5 3 6 40.6 3 6 41.8 3 6 41.8 ; proc print data = table77 ; run ; * -- these analyses assume that day is a fixed effect ; title 'Nested model, day as fixed effect analysis ' ; proc glm data = table77 ; class day run ; model glucose = day run(day) ; random run(day) / test ; lsmeans day / e = run(day) stderr ; run ; proc mixed data = table77 ; class day run ; model glucose = day ; random run(day) ; lsmeans day ; run ; * -- these analyses assume that day is a random effect ; title 'Nested model, day as random effect analysis ' ; proc glm data = table77 ; class day run ; model glucose = day run(day) ; random day run(day) / test ; lsmeans day / e = run(day) stderr ; run ; proc mixed data = table77 ; class day run ; model glucose = ; random day run(day) ; run ;