transIPCW | R Documentation |

Provides estimates for the transition probabilities based on inverse probability censoring weighted estimators, IPCW.

```
transIPCW(object, s, t, x, bw="dpik", window="normal", method.weights="NW",
state.names=c("1", "2", "3"), conf=FALSE, n.boot=1000, conf.level=0.95,
method.boot="percentile", method.est=1, ...)
```

`object` |
An object of class ‘survTP’. |

`s` |
The first time for obtaining estimates for the transition probabilities. If missing, 0 will be used. |

`t` |
The second time for obtaining estimates for the transition probabilities.
If missing, the maximum of |

`x` |
Covariate values for obtaining estimates for the conditional transition probabilities. If missing, unconditioned transition probabilities will be computed. |

`bw` |
A character string indicating a function to compute a kernel density bandwidth. Defaults to “dpik” from package KernSmooth. Alternatively a single numeric value can be specified. |

`window` |
A character string specifying the desired kernel. See details below for possible options. Defaults to “normal” where the gaussian density kernel will be used. |

`method.weights` |
A character string specifying the desired weights method. Possible options are “NW” for the Nadaraya-Watson weights and “LL” for local linear weights. Defaults to “NW”. |

`state.names` |
A vector of characters giving the state names. |

`conf` |
Provides pointwise confidence bands. Defaults to |

`n.boot` |
The number of bootstrap samples. Defaults to 1000 samples. |

`conf.level` |
Level of confidence. Defaults to 0.95 (corresponding to 95%). |

`method.boot` |
The method used to compute bootstrap confidence bands. Possible options are “percentile” and “basic”. Defaults to “percentile”. |

`method.est` |
The method used to compute the estimate. Possible options are 1 or 2. |

`...` |
Further arguments.
Typically these arguments are passed to the function specified by argument |

If `bw="dpik"`

then possible options for argument `window`

are “normal”, “box”, “epanech”, “biweight” or “triweight”.
When argument `bw`

is numeric then argument `window`

accepts the same options as when `bw="dpik"`

plus one of “tricube”, “triangular” or “cosine”.

If `method.est=1`

then `p_{11}(s,t|X)`

, `p_{12}(s,t|X)`

and `p_{22}(s,t|X)`

are estimated according to the following expressions:

`p_{11}(s,t|X)=\frac{1-P(Z \leq t|X)}{1-P(Z \leq s|X)}`

,

`p_{12}(s,t|X)=\frac{P(Z \leq t|X)-P(Z \leq s|X)-P(s<Z \leq t, T \leq t|X)}{1-P(Z \leq s|X)}`

,

`p_{22}(s,t|X) =\frac{P(Z \leq s|X)-P(Z \leq s,T \leq t|X)}{P(Z \leq s|X)-P(T \leq s|X)}`

.

Then, `p_{13}(s,t|X)=1-p_{11}(s,t|X)-p_{12}(s,t|X)`

and `p_{23}(s,t|X)=1-p_{22}(s,t|X)`

.

If `method.est=2`

then `p_{11}(s,t|X)`

, `p_{12}(s,t|X)`

and `p_{22}(s,t|X)`

are estimated according to the following expressions:

`p_{11}(s,t|X)=\frac{P(Z>t|X)}{P(Z>s|X)}`

,

`p_{12}(s,t|X)=\frac{P(s<Z \leq t,T>t|X)}{P(Z>s|X)}`

,

`p_{22}(s,t|X) =\frac{P(Z \leq s,T>t|X)}{P(Z \leq s, T>s|X)}`

.

Then, `p_{13}(s,t|X)=1-p_{11}(s,t|X)-p_{12}(s,t|X)`

and `p_{23}(s,t|X)=1-p_{22}(s,t|X)`

.

If argument `x`

is missing or if argument `object`

doesn't contain a covariate,
an object of class ‘TPmsm’ is returned. There are methods for `contour`

, `image`

, `print`

and `plot`

.
‘TPmsm’ objects are implemented as a list with elements:

`method` |
A string indicating the type of estimator used in the computation. |

`est` |
A matrix with transition probability estimates. The rows being the event times and the columns the 5 possible transitions. |

`inf` |
A matrix with the lower transition probabilities of the confidence band. The rows being the event times and the columns the 5 possible transitions. |

`sup` |
A matrix with the upper transition probabilities of the confidence band. The rows being the event times and the columns the 5 possible transitions. |

`time` |
Vector of times where the transition probabilities are computed. |

`s` |
Start of the time interval. |

`t` |
End of the time interval. |

`h` |
The bandwidth used. If the estimator doesn't require a bandwidth, it's set to |

`state.names` |
A vector of characters giving the states names. |

`n.boot` |
Number of bootstrap samples used in the computation of the confidence band. |

`conf.level` |
Level of confidence used to compute the confidence band. |

If argument `x`

is specified and argument `object`

contains a covariate,
an object of class ‘TPCmsm’ is returned. There are methods for `print`

and `plot`

.
‘TPCmsm’ objects are implemented as a list with elements:

`method` |
A string indicating the type of estimator used in the computation. |

`est` |
A 3 dimensional array with transition probability estimates. The first dimension being the event times, the second the covariate values and the last one the 5 possible transitions. |

`inf` |
A 3 dimensional array with the lower transition probabilities of the confidence band. The first dimension being the event times, the second the covariate values and the last one the 5 possible transitions. |

`sup` |
A 3 dimensional array with the upper transition probabilities of the confidence band. The first dimension being the event times, the second the covariate values and the last one the 5 possible transitions. |

`time` |
Vector of times where the transition probabilities are computed. |

`covariate` |
Vector of covariate values where the conditional transition probabilities are computed. |

`s` |
Start of the time interval. |

`t` |
End of the time interval. |

`x` |
Additional covariate values where the conditional transition probabilities are computed, which may or may not be present in the sample. |

`h` |
The bandwidth used. |

`state.names` |
A vector of characters giving the states names. |

`n.boot` |
Number of bootstrap samples used in the computation of the confidence band. |

`conf.level` |
Level of confidence used to compute the confidence band. |

Artur Araújo, Javier Roca-Pardiñas and Luís Meira-Machado

Araújo A, Meira-Machado L, Roca-Pardiñas J (2014). TPmsm: Estimation of the Transition Probabilities in
3-State Models. *Journal of Statistical Software*, **62**(4), 1-29. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v062.i04")}

Meira-Machado L., de Uña-Álvarez J., Datta S. (2011). Conditional Transition Probabilities in a non-Markov Illness-death Model. Discussion Papers in Statistics and Operation Research n 11/03. Department of Statistics and Operations Research, University of Vigo (ISSN: 1888-5756, Deposito Legal VG 1402-2007). https://depc05.webs.uvigo.es/reports/12_05.pdf

Meira Machado L. F., de Uña-Álvarez J., Cadarso-Suárez C. (2006). Nonparametric estimation of transition probabilities in a non-Markov illness-death model. *Lifetime Data Anal*, **12**(3), 325-344. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10985-006-9009-x")}

Davison, A. C., Hinkley, D. V. (1997). *Bootstrap Methods and their Application*, Chapter 5, Cambridge University Press.

`transAJ`

,
`transKMPW`

,
`transKMW`

,
`transLIN`

,
`transLS`

,
`transPAJ`

.

```
# Set the number of threads
nth <- setThreadsTP(2);
# Create survTP object with age as covariate
data(heartTP);
heartTP_obj <- with( heartTP, survTP(time1, event1, Stime, event, age=age) );
# Compute unconditioned transition probabilities
transIPCW(object=heartTP_obj, s=33, t=412);
# Compute unconditioned transition probabilities with confidence band
transIPCW(object=heartTP_obj, s=33, t=412, conf=TRUE, conf.level=0.9,
method.boot="basic", method.est=2);
# Compute conditional transition probabilities
transIPCW(object=heartTP_obj, s=33, t=412, x=0);
# Compute conditional transition probabilities with confidence band
transIPCW(object=heartTP_obj, s=33, t=412, x=0, conf=TRUE, conf.level=0.95,
n.boot=100, method.boot="percentile", method.est=2);
# Restore the number of threads
setThreadsTP(nth);
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.