# 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
{"ft_lang_label":"__label__en","ft_lang_prob":0.60205835,"math_prob":0.99260503,"size":1158,"snap":"2019-35-2019-39","text_gpt3_token_len":386,"char_repetition_ratio":0.14558059,"word_repetition_ratio":0.14689265,"special_character_ratio":0.37219343,"punctuation_ratio":0.14155251,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99617976,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-08-17T17:42:40Z\",\"WARC-Record-ID\":\"<urn:uuid:253d2be5-4ec3-463c-89b4-8e6c10348ab9>\",\"Content-Length\":\"131264\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:68d693c9-a756-47ce-85e1-923960c10298>\",\"WARC-Concurrent-To\":\"<urn:uuid:e4c5508f-0d3b-42ec-b2ed-b36dada5856f>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://stats.stackexchange.com/questions/391325/point-mass-at-zero-and-a-chi-square-distribution-with-one-degree-of-freedom\",\"WARC-Payload-Digest\":\"sha1:4NHH7YOPH2TEEWCNMO2FJ44QZFNKX7IK\",\"WARC-Block-Digest\":\"sha1:AEUEN4WDYIB4C45WW6GPF6KVYGRRY26V\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-35/CC-MAIN-2019-35_segments_1566027313436.2_warc_CC-MAIN-20190817164742-20190817190742-00476.warc.gz\"}"}