View source: R/generate_data.R
generate_phenos | R Documentation |
This function generates Gaussian phenotypes with specific block correlation
structure. If binary phenotypes are wanted, must be used in conjunction with
the generate_dependence
function: the present function
simulates latent Gaussian phenotypes which will be used in
generate_dependence
to generate binary phenotypes associated
with SNPs from a probit model.
generate_phenos(
n,
d,
var_err = 1,
cor_type = NULL,
vec_rho = NULL,
n_cpus = 1,
user_seed = NULL
)
n |
Number of observations. |
d |
Number of phenos. |
var_err |
Vector of length 1 or d containing the variances of the
(latent) Gaussian distributions used to generate the phenotypes. If of
length 1, the value is repeated d times. If binary data are targeted
(using the probit modelling within the |
cor_type |
String describing the type of dependence structure. The
phenotypes can |
vec_rho |
Vector of correlation coefficients. Its length determines the
number of blocks of correlated phenotypes. Must be smaller than d. Set to
|
n_cpus |
Number of CPUs used when simulating correlated phenotype blocks. Ignored if independent phenotypes. Set to 1 for serial execution. |
user_seed |
Seed set for reproducibility. Default is |
An object of class "sim_phenos
".
phenos |
Matrix containing the generated phenotypic data. |
var_err |
Vector containing the sample phenotypic variances. |
ind_bl |
List of length given by the number of blocks, containing the
indices of the phenotypes in each block. Is |
convert_snps
, generate_snps
,
replicate_real_snps
, convert_phenos
,
replicate_real_phenos
, generate_dependence
user_seed <- 123; set.seed(user_seed)
n <- 500; d <- 10000
cor_type <- "equicorrelated"; vec_rho <- runif(100, min = 0.25, max = 0.95)
list_phenos <- generate_phenos(n, d, cor_type = cor_type, vec_rho = vec_rho,
n_cpus = 1, user_seed = user_seed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.