***************************************************************************************************************************************************** ESTIMATOR OF THE INDIVIDUAL EFFECT SIZES ***************************************************************************************************************************************************** DOWNLOAD: -------- The Individual Effect size estimator code is downloadable from the website http://www.people.vcu.edu/~jbukszar/ The file 'ies_total.r' contains all of the codes necessary to run the individual effect size estimator. HOW TO USE THE CODE? -------------------- The syntax of the code is ies <- ies_estimator(inp_x,MeinRice=TRUE,rule=1,delrange=c(0, 20)) where THE OUTPUT ies: array containing the individual DETECTABILITY estimates. IMPORTANT: the individual effect size estimates can be obtained by dividing the individual detectability estimates by the square root of the sample size. The sample size is the number of alleles at the SNPs, i.e. two times the number of individuals. The sample size may vary across the SNPs. THE INPUTS inp_x: an array containing the test statistic values (which are assumed to follow chi-square d.f. 1 (e.g. Pearson's test stat value from allele-based case-control studies) MeinRic: if MeinRic is TRUE then Meinshausen-Rice method is used to estimate the number of positive effects, if MeinRic is FALSE then Conservative method is used to estimate the number of positive effects rule: the number added to the estimate of the number of positive effects in the stopping rule (should be either 1 or 0) delrange: the range in which the effect sizes are searched THE SIMPLEST WAY TO RUN THE CODE: --------------------------------- Type ies <- ies_estimator(x) where x is the array that contains the test statistic values. HOW TO TEST THE CODE? -------------------- Two codes, tester and tester2, are provided to test ies_estimator. -- tester: tests the individual effect size estimator 'ies_estimator' on randomly generated test statistic values that follow chi-square distribution with 1 degree of freedom. The code will display the mean of the individual effect size estimates (detectabilities) below the actual individual effect sizes (detectabilities, input argument delr) for comparison Syntax: tester(m,delr,N,rule=1,blocksiz=5, blockval=0) where the INPUTS are m: the number of markers delr: array of detectabilities; the square of the detectabilities are the non-centrality parameters of the chi-square distribution under alternative hypothesis N : the number of simulation you wish to make rule: the number added to the estimate of the number of positive effects in the stopping rule (should be either 1 or 0) blocksize: the size of the group of markers whose test statistics are correlated blockval: the correlation between the test statistics of two markers within one block (they are independent when blockval is 0 (default)) EXAMPLE: tester(100000,seq(6.6,3.8,length=10),N=5) -- tester2: tests the individual effect size estimator 'ies_estimator' on Pearson's test statistic values calculated on randomly generated contingency tables of allele-based case-control study. The code will display the mean of the individual effect size estimates (detectabilities) below the actual individual effect sizes (detectabilities, input argument delr) for comparison Syntax: tester2(maf_case,maf,num_nulls,nsample,N,rule=1,gamma=0.5) where the INPUTS are maf_case: array of minor allele frequencies of the causal markers among the cases maf: array of minor allele frequencies of the causal markers among the controls num_nulls: the number of non-causal markers nsample: sample size (number of alleles = two times the number of individuals N : the number of simulation you wish to make rule: the number added to the estimate of the number of positive effects in the stopping rule (should be either 1 or 0) gamma: the proportion of cases among in the sammple EXAMPLE: m1<-10; tester2(seq(0.4,0.35,length=m1),rep(0.3,m1),100000-m1,4000,N=5)