Learn R Programming

LocalControl (version 1.1.4)

UPSboxplot: Returns a series of boxplots comparing LTD distributions given different numbers of clusters.

Description

Given the output of LocalControlClassic, this function uses all or some of the UPSnnltd objects contained to create a series of boxplots of the local treatment difference at each of the different numbers of requested clusters.

Usage

UPSboxplot(envir, clusterSubset = c())

Value

Returns the call to boxplot with the formula: "ltd ~ numclst".

Adds the "ltdds" object to the Local Control environment.

Arguments

envir

A LocalControlClassic environment containing UPSnnltd objects.

clusterSubset

(optional) A vector containing requested cluster counts. If provided, the boxplot is created using only the UPSnnltd objects corresponding to the requested cluster counts.

Examples

Run this code

data(lindner)
cvars <- c("stent","height","female","diabetic","acutemi",
           "ejecfrac","ves1proc")
numClusters <- c(1, 5, 10, 20, 40, 50)

results <- LocalControlClassic(data = lindner,
                               clusterVars = cvars,
                               treatmentColName = "abcix",
                               outcomeColName = "cardbill",
                               clusterCounts = numClusters)

bxp <- UPSboxplot(results)

Run the code above in your browser using DataLab