Impute missing SiMLR data in a specified column based on other columns

simlr_impute(
  dataframe,
  nms,
  vecnum,
  toimpute,
  separator = "PC",
  family = "gaussian"
)

Arguments

dataframe

A data frame containing the data to impute.

nms

A vector of base column names.

vecnum

A numeric value to append to the column names.

toimpute

The base name of the target column to be imputed.

separator

A string specifying the separator between the column name and feature.

family

A string specifying the GLM family (default is 'gaussian').

Value

A data frame with imputed values.

Examples

set.seed(123)
n=50
df <- data.frame(
  t1PC1 = rnorm(n),
  t1aPC1 = rnorm(n),
  dtPC1 = rnorm(n),
  dtaPC1 = rnorm(n),
  rsfPC1 = rnorm(n),
  perfPC1 = rnorm(n)
)
df[ sample(1:nrow(df),20),6 ]=NA
nms <- c("t1", "t1a", "dt", "dta", "rsf", "perf")
vecnum <- 1
toimpute <- "perf"
df = simlr_impute(df, nms, vecnum, toimpute, family = 'gaussian')