We create some data and replace one column with
data <- matrix(rnorm(120), ncol = 10) data[, 3] <- NA print(data)
The covariance, with the implicit
use = 'everything' will give us a “cross” of
NA in the covariance matrix.
The jackknife covariance does the same thing.
When we have some
NA values in a row, we have a conceptual problem with the jackknife as the width of the jackknife distribution is linked to the number of measurements.
data <- matrix(rnorm(120), ncol = 10) data[2, ] <- NA print(data)
Also here we get the same behavior by default:
When we use
complete, we get the same thing as just dropping the
cov(data, use = 'complete')
all(cov(data, use = 'complete') == cov(data[complete.cases(data), ]))
With our jackknife function we get a failure, which should not happen!
jackknife_cov(data, na.rm = TRUE)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.