GLM.IPW: IPW estimates for a time-specific GLM using the new weight

View source: R/GLM.IPW.R

GLM.IPWR Documentation

IPW estimates for a time-specific GLM using the new weight

Description

IPW estimates of model parameters and accuracy parameters for a time-specific generalized linear model with perturbed counterparts.

Usage

GLM.IPW(
  formula,
  data,
  family = binomial(link = logit),
  id,
  case,
  control,
  m0,
  t0,
  weight.type = "HT",
  yes.match = FALSE,
  control.matching = list(Mdat = NULL, aM = NULL),
  control.accuracy = list(type = "FPR", u0 = 0.05),
  yes.ptb = FALSE,
  control.ptb = list(seed = 123, n.ptb = 500, CaseID = NULL)
)

Arguments

formula

a formula object, with the response on the left of a ~ operator, and the terms on the right. The response must be a survival object as returned by the Surv function.

data

a data.frame in which to interpret the variables named in the formula.

family

a description of the error distribution and link function to be used in the generalized linear model, which is the argument used in the glm function. The default is binominal(link=logit).

id

character, which is the variable name in the data corresponding to the column that identifies the subjects.

case

character, which is the variable name in the data corresponding to the column that 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

character, which is the variable name in the data corresponding to the column that 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. #' @param m0 a numerical value which is the number of controls selected for each case.

t0

a numerical value, which is the prediction time period, used for creating the binary outcome status: =1 if the event time is smaller than t0, = 0 otherwise.

weight.type

character which indicate which sampling weight to be used and whose value could be

"sam"

the modified Samuelsen's weight by assigning the inverse selection probability to event cases;

"new"

the modified Samuelsen's weight by assigning 0 to event cases;

"HT"

the Horvitz-Thompson type of weight, which is the default value.

yes.match

logical indicating whether the controls are selected with or without matching; the default value is FALSE.

control.matching

a list which includes two elements: Mdat and aM. Mdat is a data.frame which includes the matching variables, and its default value is NULL if the selection is without matching. aM is a numerical vector which includes the matching constraints for each matching variable, and its default value is NULL if the selection is without matching. The length of 'aM' should be the same as the number of columns of Mdat.

control.accuracy

a list which includes the arguments used in estimating the accuracy measures. It includes two elements: type and u0. type is a character which could be "FPR" or "TPR", and the default value is "FPR". u0 is a numerical value for the accuracy measure specified in type, and the default value is 0.05.

yes.ptb

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

control.ptb

a list of elements that control the perturbation procedure. seed is a numerical value used in the function set.seed, and its default value is 123. n.ptb is a numerical value indicating the number of perturbed counterparts generated, and its default value is 100. CaseID is character, which is the variable name in the data corresponding to the column that listed the case that each subject that is selected in the sub-cohort for.

Value

a list of two elements: estimates and ptb. estimates is a list of IPW estimates of the model parameters (coef) and accuracy parameters (acc). If yes.ptb=TRUE, ptb is a list of the perturbed counterparts for the IPW estimates of the model parameters (coef) and accuracy parameters (acc); otherwise, ptb = NULL.

Examples

data("myexample")
GLM.IPW(formula=Surv(time,status)~marker1+marker2,
      data=myexample$data,
      id="id",
      case="case",
      control="control",
      m0=3,t0=1,
      weight.type = "HT",
      yes.match=T,control.matching=list(Mdat=myexample$Mdat,aM=myexample$aM),
      yes.ptb=TRUE,control.ptb=list(n.ptb=10,CaseID="CaseID"))

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