build.sd.matrix: build a matrix with standard deviation

Description Usage Arguments Value Author(s) Examples

Description

Build a matrix with standard deviation.

Usage

1
build.sd.matrix(x, margin = 2, ...)

Arguments

x

a matrix or dataframe.

margin

an integer specifying the dimension that standard deviation will be computed for. 1 indicates rows, 2 indicates columns. Default is 2.

...

not used

Value

a matrix with the standard deviation. If the number of dimensions is 2, then it is ≤ft(\begin{array}{cc} σ_{1} & 0 \\ 0 & σ_{2} \end{array}\right).

Author(s)

Beibei Jiang beibei_jiang@psych.mpg.de and Benno Pütz puetz@psych.mpg.de

Examples

1
2
3
4
x1 <- rnorm(4000, mean =  5, sd = 10)
x2 <- rnorm(4000, mean = 10, sd = 30)
x <- matrix(cbind(x1, x2), ncol = 2)
build.sd.matrix(x)

Example output

         [,1]     [,2]
[1,] 9.925307  0.00000
[2,] 0.000000 30.13452

SimPhe documentation built on May 1, 2019, 9:10 p.m.