Open smcclatchy opened 3 years ago
showing spread of permutations
thrs = rep(0, 100) for(i in 1:100) { tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 10) thrs[i] = quantile(tmp, probs = 0.95) }
thrs2 = rep(0, 100) for(i in 1:100) { tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 100) thrs2[i] = quantile(tmp, probs = 0.95) }
thrs3 = rep(0, 100) for(i in 1:100) { print(i) tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 1000, cores = 4) thrs3[i] = quantile(tmp, probs = 0.95) }
data.frame(perm10 = thrs, perm100 = thrs2, perm1000 = thrs3) %>% pivot_longer(cols = everything()) %>% ggplot() + geom_density(aes(value, color = name), size = 1) + labs(title = 'Comparison of 0.05 threshold using 10 vs 100 permutation', x = 'LOD', color = 'Num. Perms')
showing spread of permutations
My permutation simulations.
thrs = rep(0, 100) for(i in 1:100) { tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 10) thrs[i] = quantile(tmp, probs = 0.95) }
thrs2 = rep(0, 100) for(i in 1:100) { tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 100) thrs2[i] = quantile(tmp, probs = 0.95) }
thrs3 = rep(0, 100) for(i in 1:100) { print(i) tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 1000, cores = 4) thrs3[i] = quantile(tmp, probs = 0.95) }
data.frame(perm10 = thrs, perm100 = thrs2, perm1000 = thrs3) %>% pivot_longer(cols = everything()) %>% ggplot() + geom_density(aes(value, color = name), size = 1) + labs(title = 'Comparison of 0.05 threshold using 10 vs 100 permutation', x = 'LOD', color = 'Num. Perms')