condquant: Quantiles of a Conditional Distribution

Description Usage Arguments Value Note Author(s) Examples

View source: R/regr.R

Description

Calculates quantiles of a conditional distribution, as well as corresponding random numbers. The condtion is simply to restrict the distribution (given by dist) to a range (given by x)

Usage

1
condquant(x, dist = "normal", sig = 1, randomrange = 0.9)

Arguments

x

matrix with 2 columns or vector of length 2 giving the limits for the conditional distribution

dist

(unconditional) distribution. Currently, only normal and logistic are implemented.

sig

standard deviation for normal distribution

randomrange

random numbers from the conditional distribution are drawn for the inner 100*randomrange percent of the suitable p-range. This avoids random extreme outliers and points close to the limit of the intervals on which they are conditioned.

Value

Matrix consisting of a row for each row of x and the following columns:

median

Median

lowq, uppq

lower and upper quartiles

random

random number according to the conditional distribution (one for each row)

prob

probability of the condition being true

Note

The function is needed for residuals.polr and residuals.survreg

Author(s)

Werner A. Stahel, Seminar for Statistics, ETH Zurich

Examples

1
condquant(cbind(seq(-2,0),c(0,1,Inf)))

regr0 documentation built on May 31, 2017, 2:26 a.m.