if (FALSE) {
library(lme4) #to use the example data
sleepstudyU <- sleepstudy
sleepstudyU$weight1L1 <- 1
sleepstudyU$weight1L2 <- 1
wm0 <- mix(Reaction ~ Days + (1|Subject), data=sleepstudyU,
weights=c("weight1L1", "weight1L2"))
wm1 <- mix(Reaction ~ Days + (1 +Days|Subject), data=sleepstudyU,
weights=c("weight1L1", "weight1L2"))
waldTest(wm0, type="beta") #test all betas
#test only beta for days
waldTest(wm0, type="beta", coefs="Days")
#test only beta for intercept against hypothesis that it is 1
waldTest(wm0, type="beta", coefs="(Intercept)", hypothesis=c(1))
waldTest(wm1,type="Lambda") #test all values of Lambda
#test only some Lambdas.The names are the same as names(wm1$theta)
waldTest(wm1,type="Lambda", coefs="Subject.(Intercept)")
#specify test values
waldTest(wm1,type="Lambda", coefs="Subject.(Intercept)", hypothesis=c(1))
}
Run the code above in your browser using DataLab