Skip to contents

The chi-square distribution with df degrees of freedom is the gamma distribution with shape = df / 2 and scale = 2, so this uses pcens_cdf.pcens_pgamma_dunif(). A non-central chi-square (ncp not zero) has no such form and uses the numerical pcens_cdf.default() method.

Usage

# S3 method for class 'pcens_pchisq_dunif'
pcens_cdf(object, q, pwindow, use_numeric = FALSE)

Arguments

object

A primarycensored object as created by new_pcens().

q

Vector of quantiles

pwindow

Primary event window. Use pwindow = 0 for an exactly observed primary event, in which case the delay CDF is used directly.

use_numeric

Logical, if TRUE forces use of numeric integration even for distributions with analytical solutions. This is primarily useful for testing purposes or for settings where the analytical solution breaks down.

Value

Vector of computed primary event censored CDFs

Examples

pcens_obj <- new_pcens(
  pdist = pchisq,
  dprimary = dunif,
  primary_args = list(min = 0, max = 1),
  df = 4
)
pcens_cdf(pcens_obj, q = c(1, 4, 8), pwindow = 1)
#> [1] 0.0326533 0.5207711 0.8876164