% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/impute_pls_data.R
\name{impute_pls_data}
\alias{impute_pls_data}
\title{Impute a predictor matrix}
\usage{
impute_pls_data(
  x,
  method = c("mice", "knn", "svd"),
  seed = NULL,
  m,
  k = 15L,
  svd_rank = 10L,
  svd_maxiter = 1000L
)
}
\arguments{
\item{x}{Incomplete predictor matrix or data frame.}

\item{method}{Imputation method: \code{"mice"}, \code{"knn"}, or \code{"svd"}.}

\item{seed}{Optional random seed forwarded to stochastic imputers when
supported.}

\item{m}{Number of imputations for \code{method = "mice"}. By default this is set
to the missing-data percentage rounded to the nearest integer.}

\item{k}{Number of neighbours for \code{method = "knn"}.}

\item{svd_rank}{Target rank for \code{method = "svd"}.}

\item{svd_maxiter}{Maximum number of iterations for the fallback SVD routine.}
}
\value{
A \code{misspls_imputation} object.
}
\description{
Apply one of the imputation strategies used in the article and thesis.
}
\examples{
sim <- simulate_pls_data(n = 20, p = 10, true_ncomp = 2, seed = 1)
miss <- add_missingness(sim$x, sim$y, mechanism = "MCAR", missing_prop = 10, seed = 2)
imp <- impute_pls_data(miss$x_incomplete, method = "knn", seed = 3)
length(imp$datasets)
}
