Learn R Programming

eLNNpairedCov (version 0.3.2)

genSimDat: Generate Simulated Data

Description

Generate a simulated dataset from a mixture of Bayesian hierarchical models with two covariates: age and sex.

Usage

genSimDat(G, n, psi, t_pi, m.age = 50, sd.age = 5, p.female = 0.5)

Value

An ExpressionSet object.

Arguments

G

integer. Number of probes.

n

integer. Number of samples.

psi

numeric. A vector of model hyper-parameters with elements \(\alpha_1\), \(\beta_1\), \(k_1\), \(\eta_{1,intercept}\), \(\eta_{1,age}\), \(\eta_{1,sex}\), \(\alpha_2\), \(\beta_2\), \(k_2\), \(\eta_{2,intercept}\), \(\eta_{2,age}\), \(\eta_{2,sex}\), \(\alpha_3\), \(\beta_3\), \(k_3\), \(\eta_{3,intercept}\), \(\eta_{3,age}\), \(\eta_{3,sex}\).

t_pi

numeric. A vector of mixture proportions: \(\pi_1\) (proportion for probes over-expressed in cases); \(\pi_2\) (proportion for probes under-expressed in cases).

m.age

numeric. mean age.

sd.age

numeric. standard deviation of age.

p.female

numeric. proportion of females.

Author

Yixin Zhang zhyl133@gmail.com, Wei Liu liuwei@mathstat.yorku.ca, Weiliang Qiu weiliang.qiu@sanofi.com

References

Zhang Y, Liu W, Qiu W. A model-based clustering via mixture of hierarchical models with covariate adjustment for detecting differentially expressed genes from paired design. BMC Bioinformatics 24, 423 (2023)

Examples

Run this code

set.seed(1234567)

true.psi = c(2, 1, 0.8,
             0.1, -0.01, -0.1,
             2, 1, 0.8,
             -0.1, -0.01, -0.1,
             2, 1, 0.8,
             -0.01, -0.1)
names(true.psi)=c("alpha1", "beta1", "k1",
                  "eta1.intercept", "eta1.Age", "eta1.Sex",
                  "alpha2", "beta2", "k2",
                  "eta2.intercept", "eta2.Age", "eta2.Sex",
                  "alpha3", "beta3", "k3",
                  "eta3.Age", "eta3.Sex")
true.pi=c(0.1, 0.1)
names(true.pi)=c("pi.OE", "pi.UE")
par.true=c(true.pi, true.psi)

esDiff = genSimDat(G = 1000, 
	       n = 20, 
	       psi = true.psi, 
	       t_pi = true.pi, 
	       m.age = 0, # scaled age 
	       sd.age = 1, # scaled age
	       p.female = 0.5)

print(esDiff)

Run the code above in your browser using DataLab