clean_data {pqrfe}R Documentation

Clean missings

Description

Clean missings

Usage

clean_data(y, x, id)

Arguments

y

Numeric vector, outcome.

x

Numeric matrix, covariates

id

Numeric vector, identifies the unit to which the observation belongs.

Value

list with the same objects y, x, id, but without missings.

Examples

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)  
 

[Package pqrfe version 1.1 Index]