calWeights: Calculate sampling weights for raw data imputation.

Description Usage Arguments Value

View source: R/calWeights.R

Description

Use logistic regression or GLMM with LASSO regularity to model missingness for time-varying correlated data. Output weights and full observation rows for each time-varying varaible.

Usage

1
2
3
4
5
6
7
8
calWeights(
  data,
  lcolnames,
  ID,
  w = c("peri", "perij"),
  timevar,
  method = "param"
)

Arguments

data

Original data (numerical variables only) with missing values.

lcolnames

A vector of longitudinal variables names.

w

Type of sampling weights or missingness level. "peri" is to consider weights on subject level, which means any subjects with partial missing would be excluded from complete cases. "perij" is to consider weights on subject and time level. Only subjects with all time points missing would be excluded from complete cases.

timevar

The time variable or cluster varaible name.

method

Missingness model. If method = "param", the function utilize logistic regression ("peri") or GLMM ("perij") for missingness model. If method = "nonparam", the function utilize random forest ("peri") for missingness model.

Value

A list contains two elements.

#' @import dplyr glmmLasso glmnet doParallel lme4 missForest REEMtree MASS nlme


SOCR/DataSifterII documentation built on Dec. 15, 2021, 10:29 a.m.