Learn R Programming

Conditional probability function of a competing event: The Cprob package

The Cprob package permits to estimate the conditional probability function of a competing event, and to fit, using the temporal process regression or the pseudo-value approach, a proportional-odds model to the conditional probability function (or other models by specifying another link function).

Installation

You can download the stable version on CRAN

install.packages("Cprob")

Or you can install the development version from github

## if necessary
## install.packages("devtools")
devtools::install_github("aallignol/Cprob")

Usage

The conditional probability function can be estimated using the cpf function.

library(Cprob)

mgus$AGE <- ifelse(mgus$age < 64, 0, 1)
CP <- cpf(Hist(time, ev)~AGE, data = mgus)
CP
summary(CP)

A regression model can be fitted either using temporal process regression

fit.cpfpo <- cpfpo(Hist(time, ev)~ age + creat,
                   data = mgus, tis=seq(10, 30, 0.3),
                   w=rep(1,67))

## and plot the odds-ratios
if(require("lattice")) {
xyplot(fit.cpfpo, scales = list(relation = "free"), layout = c(3, 1))
}

or the pseudo-values approach

data(mgus)

cutoffs <- quantile(mgus$time, probs = seq(0, 1, 0.05))[-1]

## with fancy variance estimation
fit1 <- pseudocpf(Hist(time, ev) ~ age + creat, mgus, id = id,
                  timepoints = cutoffs, corstr = "independence",
                  scale.value = TRUE)
summary(fit1)

## with jackknife variance estimation
fit2 <- pseudocpf(Hist(time, ev) ~ age + creat, mgus, id = id,
                  timepoints = cutoffs, corstr = "independence",
                  scale.value = TRUE, jack = TRUE)
summary(fit2)
}

Copy Link

Version

Install

install.packages('Cprob')

Monthly Downloads

61

Version

1.4.1

License

GPL (>= 2)

Maintainer

Arthur Allignol

Last Published

May 22nd, 2018

Functions in Cprob (1.4.1)

print.cpf

Print a cpf object
print.cpfpo

Print Method for cpfpo objects
plot.cpf

Plot method for cpf objects
mgus

Monoclonal Gammopathy of Undetermined Significance
predict.cpf

Conditional Probability Estimates at chosen timepoints
cpf

Conditional Probability Function of a Competing Event
pseudocpf

Pseudo values for the conditional probability function
summary.cpf

Summary method for cpf
lines.cpf

Lines method for 'cpf' objects
summary.pseudocpf

Summary method for pseudocpf objects
cpfpo

Proportional-odds Model for the Conditional Probability Function
xyplot.cpfpo

'xyplot' method for object of class 'cpfpo'