create.random.matrix: Random Multivariate Data Generator

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/data.generation.R

Description

Generates a matrix of dimensions nvar by nsamp consisting of random numbers generated from a normal distriubtion. This normal distribution is then perturbed to more accurately reflect experimentally acquired multivariate data.

Usage

1
create.random.matrix(nvar, nsamp, st.dev = 1, perturb = 0.2)

Arguments

nvar

Number of features (i.e. variables)

nsamp

Number of samples

st.dev

The variation (i.e. standard deviation) that is typical in datasets of interest to the user. Default spread = 1

perturb

The amount of perturbation to the normal distribution. Default perturb = 0.2

Value

Matrix of dimension nvar by nsamp

Author(s)

Charles E. Determan Jr.

References

Wongravee, K., Lloyd, G R., Hall, J., Holmboe, M. E., & Schaefer, M. L. (2009). Monte-Carlo methods for determining optimal number of significant variables. Application to mouse urinary profiles. Metabolomics, 5(4), 387-406. http://dx.doi.org/10.1007/s11306-009-0164-4

See Also

create.corr.matrix, create.discr.matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Create Multivariate Matrices

# Random Multivariate Matrix

# 50 variables, 100 samples, 1 standard devation, 0.2 noise factor

rand.mat <- create.random.matrix(nvar = 50, 
                                 nsamp = 100, 
                                 st.dev = 1, 
                                 perturb = 0.2)


# Induce correlations in a numeric matrix

# Default settings
# minimum and maximum block sizes (min.block.size = 2, max.block.size = 5)
# default correlation purturbation (k=4)
# see ?create.corr.matrix for citation for methods

corr.mat <- create.corr.matrix(rand.mat)


# Induce Discriminatory Variables

# 10 discriminatory variables (D = 10)
# default discrimination level (l = 1.5)
# default number of groups (num.groups=2)
# default correlation purturbation (k = 4)

dat.discr <- create.discr.matrix(corr.mat, D=10)

Example output

solo last variable

OmicsMarkeR documentation built on April 28, 2020, 6:54 p.m.