summary.discreteQ: Summary method for class "discreteQ"

Description Usage Arguments Details Value Examples

View source: R/summary.discreteQ.R

Description

Return a summary table for discreteQ object.

Usage

1
2
## S3 method for class 'discreteQ'
summary(object, which = NULL, taus = 0.05, ...)

Arguments

object

an object produced by discreteQ.

which

specifies the function for which the results are plotted. Possible values are (depending on the characteristics of the discreteQ object): "Q0", "Q1", "Qc", "QTE", observed", "composition", "unexplained". See ‘Details’ below.

taus

defines the quantile indexes at which the results will be shown. There are two ways to specify this argument. (i) If taus is a scalar: the results are provided for a sequence of quantiles indexes in the range defined by q.range with an increment defined by taus. (ii) taus can also be a vector containing the requested quantile indexes. Default: taus=0.05.

...

additional optional arguments.

Details

summary.discreteQ produces a matrix with the number of rows equal to the number of requested quantile indexes and 4 columns (one for the quantile index, one for the point estimate and two for the bounds of the uniform bands). The function for which the point estimates and the bands are reported depends on the type of the discreteQ object and on the value of the argument which. If the unconditional quantile function of the outcome (i.e. no treatment was provided) has been estimated, then the results for this functions are shown. If a treatment variable has been provided by decomposition=FALSE, then by default the quantile treatment effect function is shown but it is also possible to tabulate the quantile functions of the control (which="Q0") and treated outcomes (which="Q1"). If decomposition=TRUE, by default the unexplained component is shown but it is also possible to set the argument which to one of the following values: "Q0", "Q1", "Qc", "observed", "composition", "unexplained".

Value

A matrix with the same number of rows as specified with the argument taus and 4 columns. The first column contains the quantile indexes, the second column the point estimates, the third and the fourth column the uniform bands evaluated at this quantile index.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
set.seed(1234)
outcome <- rpois(100, 3)
results1 <- discreteQ(outcome)
summary(results1)

set.seed(1234)
treatment <- c(rep(0,100), rep(1,100))
reg <- rbinom(200, 1, 0.4+treatment*0.2)
outcome <- rpois(200, lambda = 2+4*reg)
results2 <- discreteQ(outcome, treatment, cbind(1, reg))
summary(results2)
summary(results2, which="Q0")

set.seed(1234)
group <- c(rep(0,100), rep(1,100))
reg <- rbinom(200, 1, 0.4+group*0.2)
outcome <- rpois(200, lambda = exp(-2+4*reg))
results3 <- discreteQ(outcome, group, cbind(1, reg), decomposition=TRUE)
summary(results3)
summary(results3, which="composition")

bmelly/discreteQ documentation built on May 22, 2021, 7:55 a.m.