Learn R Programming

LocalControlStrategy (version 1.3.1)

ltdagg: Calculate the Observed Distribution of LTDs in Local Control Strategy

Description

For a given number, K, of Clusters of Experimental Units in baseline X-covariate space, ltdagg() calculates the observed distribution of "Local Treatment Differences" (LTDs) of the form LTD = (( mean(Y) for units receiving trtm==1 ) - ( mean(Y) for units receiving trtm==0 )).

Usage

ltdagg(K, envir)

Arguments

K

Number of Clusters in baseline X-covariate space.

envir

R environment output by a previous call to LCsetup().

Value

An output list of 12 objects, of class ltdagg:

hiclus

Name of clustering object created by LCcluster().

dframe

Name of data.frame containing X, trtm & Y variables.

trtm

Name of treatment factor variable.

yvar

Name of outcome Y variable.

K

Number of Clusters Requested.

actclust

Number of Clusters delivered.

LTDtabl

data.frame with 5 columns and K rows for Clusters.

LTDtabl$c

Cluster ID Factor, "1", "2", ..., "K".

LTDtabl$LTD

Numerical value of Local Treatment Difference for a Cluster.

LTDtabl$w

Integer value of "weight" = Cluster Size.

LTDtabl$LAO

Numerical value of within-cluster Local Average Outcome (Y-value).

LTDtabl$PS

Numerical value of Propensity Score = Local Fraction of Experimental Units receiving trtm==1; 0.0 <= PS <= 1.0.

LTDdist

data.frame with 4 columns and same number of rows as the data: dframe.

LTDdist$c.K

Factor values within c("1", "2", ..., "K").

LTDdist$y

Numerical value of the Y-Outcome for an Experimental Unit.

LTDdist$t

Numerical value of trtm (0 or 1) for an Experimental Unit.

LTDdist$LTD

Numerical value of the LTD for the Cluster containing an Experimental Unit.

infoclus

Integer value of Number of Informative Clusters.

infounits

Integer value of Number of Units within Informative Clusters.

LTDmean

Numerical value of mean(LTDdist$LTD) = Weighted Average of LTDtabl$LTD values.

LTDstde

Numerical value of sqrt(var(LTDdist$LTD)) = Weighted Standard Deviation of LTDtabl$LTD values.

Details

Multiple calls to ltdagg(K) for varying numbers of clusters, K, are typically made after first invoking LCcluster() to hierarchically cluster patients in X-space and then invoking LCsetup() to specify a Y Outcome variable and a two-level, numerical treatment variable: trtm. ltdagg() computes an observed LTD Distribution, updates information stored in its envir object, and outputs an object that is typically saved in the user's .GlobalEnv to allow subsequent use by print.ltdagg(), plot.ltdagg(), confirm() or KSperm(). Uninformative Clusters (those containing either only trtm==1 units or else only trtm==0 units) contribute NA values to the LTDtabl$LTD and LTDdist$LTD objects within the ltdagg() output list object.

References

Obenchain RL. (2010) Local Control Approach using JMP. Chapter 7 of Analysis of Observational Health Care Data using SAS, Cary, NC:SAS Press, pages 151-192.

Obenchain RL. (2018) LCstrategy_in_R.pdf http://localcontrolstatistics.org

See Also

ivadj, lrcagg and LCcompare.

Examples

Run this code
# NOT RUN {
  
# }
# NOT RUN {
  # Long running example...
    data(pcidata)
    xvars <- c("stent", "height", "female", "diabetic", "acutemi", "ejfract", "ves1proc")
    hclobj <- LCcluster(pcidata, xvars)
    LCe <- LCsetup(hclobj, pcidata, thin, surv6mo)
    surv050 <- ltdagg(50, LCe)
    surv050
    plot(surv050, LCe)
  
# }

Run the code above in your browser using DataLab