Dataset_info/sleepstudy

sleepstudy 데이터셋 예제

modernity4Rcmdr 2022. 6. 25. 20:15

lme4::sleepstudy()

require(lme4)
?sleepstudy  # sleepstudy 데이터셋 도움말 보기

아래는 example(sleepstudy) 입니다.

str(sleepstudy)
require(lattice)
xyplot(Reaction ~ Days | Subject, sleepstudy, type = c("g","p","r"),
       index = function(x,y) coef(lm(y ~ x))[1],
       xlab = "Days of sleep deprivation",
       ylab = "Average reaction time (ms)", aspect = "xy")
(fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
(fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy))

Linux 사례 (MX 21)
Linux 사례 (MX 21)
Linux 사례 (MX 21)

fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy)

Linux 사례 (MX 21)
Linux 사례 (MX 21)
Linux 사례 (MX 21)
Linux 사례 (MX 21)