library(LBRAT)
#> Warning: package 'lme4' was built under R version 3.5.2
#> Warning: package 'Matrix' was built under R version 3.5.2
#> Warning: package 'mvtnorm' was built under R version 3.5.2
#> Warning: package 'data.table' was built under R version 3.5.2
Use a simulated longitudinal binary phenotype and genotype data with random ascertainment for 1000 subjects, each with 5 repeated measures. Each subject has 2 causal SNPs.
p0 = lbrat_simu(n.sample = 1000, n.time =5, onlypower=T)
#> * No ascertainment, random sampling:
#> [1] "logistic phenotypes"
#> Disease Prevalence: 0.129 0.166 0.205 0.225 0.253
Estimate GEE null model:
m0 = lbrat_est.gee(y.long = p0$phe.long, y.cov = p0$phe.cov.long, time = p0$phe.time)
#> Phenotype is dichotomous, fitting logistic link ......
Perform L-BRAT and GEE tests
p_val = lbrat_test(m0, G = p0$snp.mat)
tail(p_val)
#> score.pro score.retro pval.pro pval.retro maf
#> CAUSAL1 0.09917673 0.0994929 0.75281984 0.752439026 0.499
#> CAUSAL2 6.16826217 7.9023876 0.01300623 0.004936959 0.102
where score.pro
is GEE score statistics; score.retro
is L-BRAT score statistics, pval.pro
is GEE P-value and pval.retro
is L-BRAT P-value.