| Type: | Package | 
| Title: | Estimation of Mean Costs in Censored Data | 
| Version: | 0.1.0 | 
| Description: | Implementation of estimators for inferring the mean of censored cost data. Including the estimators BT from Bang and Tsiatis (2000) <doi:10.1093/biomet/87.2.329> and ZT from Zhao and Tian (2001) <doi:10.1111/j.0006-341X.2001.01002.x>. | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| RoxygenNote: | 6.1.1 | 
| Suggests: | rmarkdown, parallel, testthat (≥ 2.1.0) | 
| VignetteBuilder: | knitr | 
| Imports: | ggplot2, dplyr, tibble, knitr, msm, forcats, rlang, data.table, survival, Rdpack | 
| Depends: | R (≥ 3.5.0) | 
| RdMacros: | Rdpack | 
| NeedsCompilation: | no | 
| Packaged: | 2019-09-06 10:34:08 UTC; larsn | 
| Author: | Lars Boerty | 
| Maintainer: | Lars Boerty <lars.borty@gmail.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2019-09-09 10:10:02 UTC | 
Calculates estimates of the mean cost with censored data
Description
This function calculates the mean cost for right-censored cost data over a period of L time units (days, months, years,...)
Usage
ccmean(x, L = max(x$surv), addInterPol = 0)
Arguments
| x | A dataframe with columns: id, cost, delta and surv. If Cost history is available it can be specified by: start and stop, | 
| L | Limit. Mean cost is calculated up till L, if not specified L = max(surv) | 
| addInterPol | This parameter affects the interpolation of cost between two observed times. Defaults to zero. | 
Details
The function returns four estimates. The first two are simple and biased downwards, and included for comparison. The estimates are:
- AS: "Available Sample estimator" - The simple sample mean
- CC: "Complete Case estimator" - The mean of fully observed cases
- BT: "Weighted Complete Case estimator" - Bang and Tsiatis's estimator
- ZT: "Weighted Available estimator" - Zhao and Tian's estimator
The function needs the following in a dataframe:
- id: The id separating each individual
- cost: The total cost, or if start and stop provided the specific cost
- start: Start of cost
- stop: End of cost, if one time cost then start = stop
- delta: Event variable, 1 = event, 0 = no event
- surv: Survival
Value
An object of class "ccobject".
References
Bang H, Tsiatis AA (2000). “Estimating medical costs with censored data.” Biometrika, 87(2), 329–343. ISSN 00063444, doi: 10.1093/biomet/87.2.329.
Zhao H, Tian L (2001). “On Estimating Medical Cost and Incremental Cost-Effectiveness Ratios with Censored Data.” Biometrics, 57(4), 1002–1008. ISSN 0006341X, doi: 10.1111/j.0006-341X.2001.01002.x.
Examples
hcost
ccmean(hcost, L = 1461, addInterPol = 1)
Simulated data from the stata hcost package
Description
Simulated data from the stata hcost package
Usage
data(hcost)
Format
A data frame with 9882 rows and 7 variables:
- id
- id seperating individuals 
- start
- start of specified cost 
- stop
- end of specified cost 
- cost
- cost in given period 
- trt
- treatment variable 
- delta
- event variable, 0 = censored 
- surv
- survival period 
Source
References
Chen S, Rolfes J, Zhao H (2015). “Estimation of Mean Health Care Costs and Incremental Cost-effectiveness Ratios with Possibly Censored Data.” The Stata Journal: Promoting communications on statistics and Stata, 15(3), 698–711. ISSN 1536-867X, doi: 10.1177/1536867X1501500305, The Stata Journal.
Examples
data(hcost)
Adding to the generic plot function
Description
Adding to the generic plot function
Usage
## S3 method for class 'ccobject'
plot(x, ...)
Arguments
| x | The ccobject | 
| ... | passthrough | 
Value
a plot
Adding to the generic print function
Description
Adding to the generic print function
Usage
## S3 method for class 'ccobject'
print(x, ...)
Arguments
| x | The ccobject | 
| ... | passthrough | 
Value
a plot
Simulates censored cost data
Description
This function can be used to demonstrate the bias and coverage of the estimators in the ccmean function
Usage
simCostData(n = 100, dist = "unif", censor = "light",
  cdist = "exp", L = 10)
Arguments
| n | Number of individuals to simulate | 
| dist | Survival distribution either "unif" = unif(0,10) o r "exp" = exp (1/6) | 
| censor | Censoring "light" ~ 25% or "heavy" ~ 40%, changes a bit depending on cdist | 
| cdist | Distribution used to censor, "exp" exponential or "unif" uniform | 
| L | Number of years to summarize over | 
Details
The function simulates survival times from either an uniform distribution or an exponential distribution, and a cost history. There are two options for censoring, heavy (~40 light (~25
Value
Simulation of censored cost
References
Lin DY, Feuer EJ, Etzioni R, Wax Y (1997). “Estimating Medical Costs from Incomplete Follow-Up Data.” Biometrics, 53(2), 419. ISSN 0006341X, doi: 10.2307/2533947.
Examples
# The simulated data can be used to show how the estimators perform
simCostData(n = 100, dist = "unif", censor = "light", cdist = "exp", L = 10)