View source: R/compute_sample_size.R
compute_sample_size | R Documentation |
Computes sample sum (as new column "N") or effective sample size (ESS) (as new column "Neff"). Computing ESS is important as it takes into account the proportion of cases to controls (i.e. class imbalance) so as not to overestimate your statistical power.
compute_sample_size(
sumstats_dt,
method = c("ldsc", "giant", "metal", "sum"),
force_new = FALSE,
append_method_name = FALSE
)
sumstats_dt |
Summary statistics data.table. |
method |
Method for computing (effective) sample size.
|
force_new |
If "Neff" (or "N") already exists in |
append_method_name |
should Neff column have an indicator to explain the method that makes it., Default is FALSE unless multiple methods are passed |
There are many different formulas for calculating ESS, but LDSC is probably the best method available here, as it doesn't assume that the proportion of controls:cases is 2:1 (as in GIANT) or 4:1 (as in METAL).
A data.table with a new column "Neff" or "N"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.