2

I want to know if the concept of Restricted Maximum Likelihood (REML) applies to non-mixed models. For example, suppose we want to perform a test equivalent of the one-sample t-test, it may be possible to use ML or REML (related link):

n <- 10       # sample size
a <- 0.1      # null hypothesis: true mean = a
y <- rnorm(n) # sample data

M0 <- glm(y~-1,offset=rep(a,n)) # null hypothesis
M1 <- glm(y~1) 

### ML based
(D0 <- sum(dnorm(y,a,sqrt(sum((y-a)^2)/n),log=T))) # logLik(M0)
(D1 <- sum(dnorm(y,mean(y),sqrt(var(y)*((n-1)/n)),log=T))) # logLik(M1)
library(lmtest)
lrtest(M0,M1)
pchisq(2*(D1-D0),1,lower.tail=FALSE) # recover the same p-value


### REML based
d0 <- sum(dnorm(y,a,sd(y),log=T))    # sd(y) does not use H0: mean = a
d1 <- sum(dnorm(y,mean(y),sd(y),log=T))
anova(M0,M1,test="LRT")
pchisq(2*(d1-d0),1,lower.tail=FALSE) # recover the same p-value

In the code above, I stated "REML based" but I don't know if the likelihood ratio test based on anova is considered as REML based. If it is REML --- suggestions commonly say that comparing different fixed effects using REML is not good [i.e., REML likelihoods are not compatible when fixed effects change] (e.g., link). Then, comparing normal distribution models using anova (LRT) is not considered comparing fixed effect models using REML? I used the one-sample t-test example, but the question is not about the specific example.

quibble
  • 1,167
  • 10
  • 17

0 Answers0