cond_imp_logistic: Conditional Imputation for Logistic Scalar-on-Function...

Description Usage Arguments Details Value Author(s)

View source: R/cond_imp_logistic.R

Description

Given the imputation parameters, this function imputes the scores using their distribution conditional on the observed values of the curves and the response variable. In the case of logistic regression, this essentially means that imputation is performed separately within each group of the response variable. Muliple or mean imputation can be chosen.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
cond_imp_logistic(
  dat,
  workGrid,
  nimps = 10,
  seed = NULL,
  impute_type = "Multiple",
  mu0 = NULL,
  mu1 = NULL,
  var_delt = NULL,
  Cx = NULL,
  phi = NULL,
  lam = NULL,
  tol = 1e-05
)

Arguments

dat

An n \times 4 data frame (where N is the number of subjects, each with m_i observations, so that ∑_{i=1}^N m_i = n) expected to have variables 'X','y','subj', and 'argvals'.

workGrid

A vector of the unique desired grid points on which to evaluate the function. The length of this vector will be called M.

nimps

An integer specifying the number of desired imputations, if impute_type is "Multiple".

seed

A numeric value used to set the seed for reproducibility (useful for multiple imputation).

impute_type

A string used to choose between mean and multiple imputation. Should be one of "Mean" or "Multiple".

mu0

A numeric vector of length M specifying the mean function for the 0 group, evaluated at workGrid.

mu1

A numeric vector of length M specifying the mean function for the 1 group, evaluated at workGrid.

var_delt

A number representing σ^2_δ, the variance of the noise.

Cx

An M \times M matrix for the covariance function of X, evaluated at workGrid.

phi

An M \times J matrix whose columns are the J eigenfunctions of C_X, each evaluate at workGrid.

lam

A length-J numeric vector containing the eigenvalues of C_X.

tol

A (small) numerical value that sets the tolerance for trimming the eigenvalues of the conditional covariance.

Details

The variables of dat should be specified as follows: 'X' specifies the observed values of the curves (no missing values here); 'y' should be a vector of 1's and 0's such that the values of 'y' are the same for each subject; 'subj' should contain unique numeric identifiers for each subject, and 'argvals' should indicate the time point at which each observation was made (note that these values should be a subset of workGrid).

Value

Either a N\times J matrix of imputed scores if impute_type is set to "Mean", or a 3-dimensional array of dimension N\times J\times nimps if impute_type is set to "Multiple".

Author(s)

Jusitn Petrovich, jpetrovich02@gmail.com


justin-petrovich/sparsefreg documentation built on Aug. 20, 2020, 9:04 p.m.