LocalControlClassic: Local Control Classic

View source: R/clusteringLC.R

LocalControlClassicR Documentation

Local Control Classic

Description

LocalControlClassic was originally contained in the deprecated CRAN package USPS, this function is a combination of three of the original USPS functions, UPShclus, UPSaccum, and UPSnnltd. This replicates the original implementation of the Local Control functionality in Robert Obenchain's USPS package. Some of the features have been removed due to deprecation of R packages distributed through CRAN. For a given number of patient clusters in baseline X-covariate space, LocalControlClassic() characterizes the distribution of Nearest Neighbor "Local Treatement Differences" (LTDs) on a specified Y-outcome variable.

Usage

LocalControlClassic(
  data,
  clusterVars,
  treatmentColName,
  outcomeColName,
  faclev = 3,
  scedas = "homo",
  clusterMethod = "ward",
  clusterDist = "euclidean",
  clusterCounts = c(50, 100, 200)
)

Arguments

data

The data frame containing all baseline X covariates.

clusterVars

List of names of X variable(s).

treatmentColName

Name of treatment factor variable.

outcomeColName

Name of outcome Y variable.

faclev

Maximum number of different numerical values an outcome variable can assume without automatically being converted into a "factor" variable; faclev=1 causes a binary indicator to be treated as a continuous variable determining an average or proportion.

scedas

Scedasticity assumption: "homo" or "hete".

clusterMethod

Type of clustering method, defaults to "complete". Currently implemented methods: "ward", "single", "complete" or "average".

clusterDist

Distance type to use, defaults to "euclidean". Currently implemented: "euclidiean", "manhattan", "maximum", or "minkowski".

clusterCounts

A vector containing different number of clusters in baseline X-covariate space which Local Control will iterate over.

Value

Returns a list containing several elements.

hiclus

Name of clustering object created by UPShclus().

dframe

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

trtm

Name of treatment factor variable.

yvar

Name of outcome Y variable.

numclust

Number of clusters requested.

actclust

Number of clusters actually produced.

scedas

Scedasticity assumption: "homo" or "hete"

PStdif

Character string describing the treatment difference.

nnhbindf

Vector containing cluster number for each patient.

rawmean

Unadjusted outcome mean by treatment group.

rawvars

Unadjusted outcome variance by treatment group.

rawfreq

Number of patients by treatment group.

ratdif

Unadjusted mean outcome difference between treatments.

ratsde

Standard error of unadjusted mean treatment difference.

binmean

Unadjusted mean outcome by cluster and treatment.

binvars

Unadjusted variance by cluster and treatment.

binfreq

Number of patients by bin and treatment.

awbdif

Across cluster average difference with cluster size weights.

awbsde

Standard error of awbdif.

wwbdif

Across cluster average difference, inverse variance weights.

wwbsde

Standard error of wwbdif.

faclev

Maximum number of different numerical values an outcome variable can assume without automatically being converted into a "factor" variable; faclev=1 causes a binary indicator to be treated as a continuous variable determining an average or proportion.

youtype

"continuous" => only next eight outputs; "factor" => only last three outputs.

aovdiff

ANOVA summary for treatment main effect only.

form2

Formula for outcome differences due to bins and to treatment nested within bins.

bindiff

ANOVA summary for treatment nested within cluster.

sig2

Estimate of error mean square in nested model.

pbindif

Unadjusted treatment difference by cluster.

pbinsde

Standard error of the unadjusted difference by cluster.

pbinsiz

Cluster radii measure: square root of total number of patients.

symsiz

Symbol size of largest possible Snowball in a UPSnnltd() plot with 1 cluster.

factab

Marginal table of counts by Y-factor level and treatment.

cumchi

Cumulative Chi-Square statistic for interaction in the three-way, nested table.

cumdf

Degrees of-Freedom for the Cumulative Chi-Squared.

References

  • Obenchain, RL. USPS package: Unsupervised and Supervised Propensity Scoring in R. https://cran.r-project.org/src/contrib/Archive/USPS/ 2005.

  • Obenchain, RL. The ”Local Control” Approach to Adjustment for Treatment Selection Bias and Confounding (illustrated with JMP Scripts). Observational Studies. Cary, NC: SAS Press. 2009.

  • Obenchain RL. The local control approach using JMP. In: Faries D, Leon AC, Haro JM, Obenchain RL, eds. Analysis of Observational Health Care Data Using SAS. Cary, NC: SAS Institute; 2010:151-194.

  • Obenchain RL, Young SS. Advancing statistical thinking in observational health care research. J Stat Theory Pract. 2013;7(2):456-506.

  • Faries DE, Chen Y, Lipkovich I, Zagar A, Liu X, Obenchain RL. Local control for identifying subgroups of interest in observational research: persistence of treatment for major depressive disorder. Int J Methods Psychiatr Res. 2013;22(3):185-194.

  • Lopiano KK, Obenchain RL, Young SS. Fair treatment comparisons in observational research. Stat Anal Data Min. 2014;7(5):376-384.

  • Young SS, Obenchain RL, Lambert CG (2016) A problem of bias and response heterogeneity. In: Alan Moghissi A, Ross G (eds) Standing with giants: A collection of public health essays in memoriam to Dr. Elizabeth M. Whelan. American Council on Science and Health, New York, NY, pp 153-169.

Examples

 data(lindner)

 cvars <- c("stent","height","female","diabetic","acutemi",
            "ejecfrac","ves1proc")
 numClusters <- c(1, 2, 10, 15, 20, 25, 30, 35, 40, 45, 50)
 results <- LocalControlClassic( data = lindner,
                                clusterVars = cvars,
                                treatmentColName = "abcix",
                                outcomeColName = "cardbill",
                                clusterCounts = numClusters)
 UPSLTDdist(results,ylim=c(-15000,15000))


OHDSI/LocalControl documentation built on Feb. 11, 2024, 9:14 a.m.