Learn R Programming

deform (version 1.0.0)

cencov: Correlation and covariance matrices from censored data

Description

Correlation and covariance matrices from censored data

Usage

cencov(x, u)

cencor(x, u)

Value

a matrix

Arguments

x

a numeric matrix

u

a numeric matrix giving corresponding points of left-censoring

Details

For cencov() a covariance matrix is returned and for cencor() a correlation matrix is returned. Note that cencov() calls cencor(). Estimates are based on assuming values are from a multivariate Gaussian distribution.

See Also

cov and cor for uncensored estimates.

Examples

Run this code

# generate some correlated data
n <- 1e2
x <- rnorm(n)
y <- 0.25 * x + sqrt(0.75) * rnorm(n)
xy <- cbind(x, y)
# threshold of zero for left-censoring
u <- matrix(0, n, 2) 
# left-censored correlation matrix
cencor(xy, u) # could check with cor(xy)
# left-censored covariance matrix
cencov(xy, u)

Run the code above in your browser using DataLab