VisualCPT: Visualization of Difference in Current Procedural Terminology...

Description Usage Arguments Details Value Author(s) Examples

View source: R/VisualCPT.R

Description

Determine existance and estimate difference in endorsement of CPT codes between two health systems. Use Clickme package to create an interactive visualization in the browser that desplay the estimated rate ratios, significance level, and code informations. Use the Clinical Classifications Software for Services and Procedures (CCS-S&P) to group CPT codes describing similar medical procedures.

Usage

1
VisualCPT(id, code, site, method = "Elasticnet", alpha = 0.5, testmethod="NBExact", output_path = getwd(), template_path = getwd(), opacity = 0.6, radius = 4.5, height = 450, width = 890)

Arguments

id

Patient ID. A vector of integers.

code

CPT code. A vector of the same length as id. This records CPT code assigned to a patient at some visit. One CPT code can be assigned to a patient at multiple times, recorded repeatedly here.

site

The healte care center each code was assigned at.

method

Method for estimating the rate ratio, method = "GLMM", "Lasso", "Ridge", or "Elasticnet".

alpha

For "Elasticnet" method, an alpha value need to be specified denoting weight of lasso penalty. For more details please see the documentation of the glmnet package.

testmethod

Method for hypothesis testing, choices include "NBLRT" (likelihood ratio test assuming Negative Binomial model), "NBExact" (exact test assuming Negative Binomial model), "PoisLRT" (likelihood ratio test assuming Poisson model), "PoisExact" (exact test assuming Poisson model), "BinLRT" (likelihood ratio test after dichotomizing count of code assignments, assuming Binomial model), "FishersExact" (Fisher's exact test for dichotomized count of code assignments), "Ttest" (two-sample T-test assuming equal variance).

output_path, template_path

The path of directory to store the .html file and clickme asset (.js files) for the interactive plot.

opacity

Opacity of points in the plot.

radius

Radius of circles in the plot. Determines the size of each point.

height, width

The height and width of the plot region in inches.

Details

Apply either Generalized Linear Mixed Model or Penalized Regression to estimate rate ratio comparing CPT code usage between two sites. Analyses take into account similarity in procedures described by certain CPT codes. P values are computed based on likelihood ratio tests.

Value

This function generates an .html file and a binder named "clickme_assets" which scores .js codes. The .html file need to be stored in the same directory as the "clickme_assets".

Point at each dot in the plot gives some basic information about the code, the procedure group it blongs to, the rate ratio, the p value, the raw number of times the code was assigned at each site, as well as the number of patients in each site.

You could search for a certain code or hide certain codes of some significant levels. Scrolling with three fingers moves the plot; scrolling with two fingers zooms in/out.

Author(s)

Xu Shi <xushi@uw.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--  or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (id, code, site, method = "Elasticnet", alpha = 0.5, 
    output_path = getwd(), template_path = getwd(), opacity = 0.6, 
    radius = 4.5, height = 450, width = 890) 
{
    cpt = QC(id, code, site)
    cpt = grpcode(cptnonnum, cptnum)
    cpt = renameNonnumeric(cpt)
    dat = SufficientData(cpt)
    pdata_name = PData(dat, method = "Elasticnet", alpha = 0.5)
    pdata = pdata_name[[1]]
    name = pdata_name[[2]]
    options(clickme_output_path = output_path, clickme_template_path = output_path)
    clickme(points, title = name, x = pdata$block, y = pdata$log2RR, 
        names = pdata$code, extra = list(Info = pdata$extra), 
        xlab = "block #", ylab = "log2RR", palette = c(`> 0.05` = "#E0E0E0", 
            `0.05 - 0.01` = "#be29ec", `0.01 - sig` = "#3bd6c6", 
            sig. = "red"), color_groups = pdata$level, opacity = opacity, 
        radius = radius, out_height = height, out_width = width, 
        font = "Arial", file = paste(name, ".html", sep = ""))$iframe()
    print(paste("The .html file is in ", output_path, sep = ""))
  }

shixu0830/VisualCPT documentation built on May 29, 2019, 9:26 p.m.