SL.wang: Quantile regression method of Wang and Zhou (2009)

Description Usage Arguments Value References Examples

View source: R/SL.wang.R

Description

This function implements the estimator of Wang and Zhou (2010). The estimator estimates the conditional mean costs by modeling the conditional quantiles of a transformed cost. Using the equivariance property of quantiles to monotone transformations, the quantile estimators may be transformed back to the conditional mean cost on the original scale.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SL.wang(
  Y,
  X,
  newX,
  family = gaussian(),
  obsWeights = rep(1, length(Y)),
  g = "log",
  m = length(Y),
  c = 0.2,
  b = 0.05,
  ...
)

Arguments

Y

A numeric outcome variable

X

A data.frame of covariates constituting the training sample

newX

A data.frame with the same column names and format as X constituting the validation sample.

family

Gaussian only

obsWeights

Observation-level weights (not currently used)

g

Transformation to apply to Y before quantile regression is used. Choices are "log" or "sqrt"

m

Number of quantiles to compute

c

Constant used to determine truncation level for transforming quantiles to conditional mean

b

Constant used to determine truncation level for transforming quantiles to conditional mean

...

Other arguments (not currently used)

Value

pred

Predicted outcomes based on predictors in newX

fit

A list with named entries object (the fitted rq regression object), alpha (the controlled level of trimming based), and g_inv (the inverse function of the inputted g)

References

Wang HJ, Zhou X (2010). “Estimation of the retransformed conditional mean in health care cost studies.” Biometrika, 97(1), 147–158.

Examples

1
2
3
4
5
# load cost data
data(cost_data)
# fit wang model
fit_wang <- SL.wang(Y = cost_data$totalcost, X = cost_data[, c("female", "race")],
                    newX = cost_data[, c("female", "race")])

wuziyueemory/twostageSL documentation built on Oct. 19, 2020, 3:45 p.m.