# Point mass at zero and a chi square distribution with one degree of freedom

I am unclear about the critical value of a point mass at zero and a chi square distribution with one degree of freedom. How to find this?

## 1 Answer

If instead of the critical value you're interested in the p-value, you can get that by calculating the mean of the two corresponding p-values. For example, check the following:

library("nlme")

data("aids", package = "JM")

# model with random intercepts & slopes
fm_s310_aids1 <- lme(CD4 ~ obstime + I(obstime^2) + (obstime + I(obstime^2)):drug,
data = aids, random = ~ obstime | patient)

# model with random intercepts, slopes & slopes^2
fm_s310_aids2 <- lme(CD4 ~ obstime + I(obstime^2) + (obstime + I(obstime^2)):drug,
data = aids, random = ~ obstime + I(obstime^2) | patient,
control = lmeControl(opt = "optim"))

# classical LRT with default chi-squared distribution
aov <- anova(fm_s310_aids1, fm_s310_aids2)
aov
#>               Model df      AIC      BIC    logLik   Test  L.Ratio p-value
#> fm_s310_aids1     1  9 7165.768 7212.966 -3573.884
#> fm_s310_aids2     2 12 7165.425 7228.355 -3570.712 1 vs 2 6.343191  0.0961

# p-value from mixture of chi-squared distsributions
mean(pchisq(aov\$L.Ratio, df = c(2, 3), lower.tail = FALSE))
#>  0.06899638