htWGT: Calculate the new weight by reformularizing the NCC sampling...

View source: R/helpers.R

htWGTR Documentation

Calculate the new weight by reformularizing the NCC sampling as a two-stage stratified sampling

Description

This proposed weight is the Horvitz-Thompson type of weight.

Usage

htWGT(
  xi,
  di,
  id,
  case,
  control,
  m0,
  M.dat = NULL,
  a.M = NULL,
  yes.ptb = FALSE,
  control.list = list(CaseID = NULL, Vii.ptb = NULL, yes.parallel = FALSE)
)

Arguments

xi

a vector of censored event times.

di

a vector of binary values (1 or 0) indicating whether the true event time is observed.

id

a vector which identifies the subjects.

case

a vector which indicates whether each subject is a sub-cohort case. The value is 1 if the subject is a sub-cohort case, and it is 0 if the subject is not a sub-cohort case.

control

a vector which indicates whether each subject is a sub-cohort control. The value is 1 if the subject is a sub-cohort control, and it is 0 if the subject is not a sub-cohort control.

m0

a numerical value which is the number of controls selected for each case.

M.dat

a data.frame which includes the matching variables. The default value is NULL if the selection is without matching.

a.M

a numerical vector which includes the matching constraint for each matching variable. The default value is NULL if the selection is without matching.

yes.ptb

logical indicating if obtaining the perturbed counterparts of the IPW estimates, and the default value is FALSE.

control.list

a list including two elements: CaseID and Vii.ptb that control the perturbation procedure. CaseID is a vector in which listed the case that each subject that is selected in the sub-cohort for. If id is the same as CaseID, it indicates this subject is one of the sub-cohort cases. Vii.ptb is a vector of perturbation variables, and the default value is NULL if the perturbation procedure is not implemented for estimating the variance of the IPW estimators.

Value

If yes.ptb=FALSE, it returns a single-column matrix which includes the NCC weights; otherwise, it returns a matrix with the first column being the NCC weights and the remaining columns being their perturbed counterparts.


michellezhou2009/NCCIPW documentation built on April 25, 2022, 3:39 p.m.