clean_data | R Documentation |
Clean missings
clean_data(y, x, id)
y |
Numeric vector, outcome. |
x |
Numeric matrix, covariates |
id |
Numeric vector, identifies the unit to which the observation belongs. |
list with the same objects y, x, id, but without missings.
n = 10 m = 4 d = 3 N = n*m L = N*d x = matrix(rnorm(L), ncol=d, nrow=N) subj = rep(1:n, each=m) alpha = rnorm(n) beta = rnorm(d) eps = rnorm(N) y = x %*% beta + matrix(rep(alpha, each=m) + eps) y = as.vector(y) x[1,3] = NA clean_data(y=y, x=x, id=subj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.