Learn R Programming

LocalControlStrategy (version 1.3.1)

lrcagg: Calculate the observed Distribution of LRCs in Local Control Strategy

Description

For a given number, K, of Clusters of Experimental Units in baseline X-covariate space, lrcagg() calculates the observed distribution of "Local Rank Correlations" (LRCs) across Clusters ...where each LRC = cor(trex, Y, method = "spearman") within a Cluster, trex is a numeric measure of Exposure, and Y is a numeric measure of Outcome.

Usage

lrcagg(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 lrcagg:

hclobj

Name of clustering dendrogram object created by LCcluster().

dframe

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

trex

Name of numerical treatment/exposure level variable.

yvar

Name of outcome Y variable.

K

Number of Clusters Requested.

actclust

Number of Clusters delivered.

LRCtabl

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

LRCtabl$c

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

LRCtabl$LRC

Numerical value of Local Treatment Difference for a Cluster.

LRCtabl$w

Integer value of "weight" = Cluster Size.

LRCtabl$LAO

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

LRCtabl$PS

Numerical value of Local Relative Propensity for Exposure, 0.0 to 1.0.

LRCdist

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

LRCdist$c.K

Name for the Cluster ID Variable of the form: "c.K"

LRCdist$y

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

LRCdist$t

Numerical value of trex Exposure Level for an Experimental Unit.

LRCdist$LRC

Numerical value of the LRC for the Cluster containing each Experimental Unit.

infoclus

Integer value of Number of Informative Clusters.

infounits

Integer value of Number of Units within Informative Clusters.

LRCmean

Numerical value of mean(LRCdist$LRC) = Weighted Average of LRCtabl$LRC values.

LRCstde

Numerical value of sqrt(var(LRCdist$LRC)) = Weighted Standard Deviation of LRCtabl$LRC values.

Details

Multiple calls to lrcagg(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 continuous, numerical treatment Exposure: trex. lrcagg() computes an observed LRC 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.lrcagg(), plot.lrcagg(), confirm() or KSperm(). Uninformative Clusters (those containing only 1 or 2 experimental units) contribute NA values to the LRCtabl$LRC and LRCdist$LRC objects within the lrcagg() output list.

References

Obenchain RL. (2010) The 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, ltdagg and LCcompare.

Examples

Run this code
# NOT RUN {
    data(radon)
    xvars <- c("obesity", "over65", "cursmoke")
    hclobj <- LCcluster(radon, xvars)
    e <- LCsetup(hclobj, radon, lnradon, lcanmort)
    lrc050 <- lrcagg(50, e)
    lrc050
    plot(lrc050, e)
# }

Run the code above in your browser using DataLab