Learn R Programming

TcGSA (version 0.10.1)

rmixchisq: Random Generation of Chi-square Mixtures

Description

rmixchisq is used to simulate a mixture of chi-square distributions that corresponds to the null distribution of the Likelihood Ratio between 2 nested mixed models.

Usage

rmixchisq(n, s, q)

Arguments

n
number of observations.
s
number of fixed effects to be tested.
q
number of random effects to be tested.

Value

A vector of random independent observations of the chisquare mixture identified by the values of s and q.

Details

The approximate null distribution of a likelihood ratio for 2 nested mixed models, where both fixed and random effects are tested simultaneously, is a very specific mixture of $\chi^2$ distributions [Self & Liang (1987), Stram & Lee (1994) and Stram & Lee (1995)]. It depends on both the number of random effects and the number of fixed effects to be tested simultaneously: $$LRT_{H_0}\sim\sum_{k=q}^{q+r}{{r}\choose{k-q}}2^{-r}\chi^2_{(k)}$$

References

Self, S. G. and Liang, K., 1987, Asymptotic properties of maximum likelihood estimators and likelihood ratio tests under nonstandard conditions, Journal of the American Statistical Association 82: 605--610.

Stram, D. O. and Lee, J. W., 1994, Variance components testing in the longitudinal mixed effects model, Biometrics 50: 1171--1177.

Stram, D. O. and Lee, J. W., 1995, Corrections to "Variance components testing in the longitudinal mixed effects model" by Stram, D. O. and Lee, J. W.; 50: 1171--1177 (1994), Biometrics 51: 1196.

See Also

pval_simu

Examples

Run this code
library(graphics)
library(stats)

sample_mixt <- rmixchisq(n=1000, s=3, q=3)
plot(density(sample_mixt))


Run the code above in your browser using DataLab