Skip to content

Commit

Permalink
ready to change to the chisq distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayi-s committed Jan 19, 2024
1 parent 47b00c9 commit a15efa0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/mJAM_build_CS.R
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ mJAM_get_PrMed <- function(GItGI, GIty,yty, yty_med, N_GWAS, g = NULL,C_id, X_id

med_test_stat <- (C_Y_post_mean[1] - CX_Y_post_mean[2])/sqrt(C_Y_post_var[1,1] + CX_Y_post_var[2,2])
Post_Med_Prob <- 2*(0.5-pnorm(abs(med_test_stat), lower.tail = F))
# Post_Med_Prob <- pchisq(med_test_stat^2, df = 1,lower.tail = TRUE) # equivalent to a chi-sq with df=1

return(list(Post_Med_Prob = Post_Med_Prob,
Med_Effect_Size = C_Y_post_mean[1] - CX_Y_post_mean[2],
Expand Down

0 comments on commit a15efa0

Please sign in to comment.