rectime: Fit the marginal rates models

Description Usage Arguments Details Examples

View source: R/rectime.R

Description

Fit one of the following rates models for recurrent event data: proportional rates model, additive rates model, additive-multiplicative rates model. Provides three methods to deal with the time-dependent covariates.

Usage

1
2
rectime(formula, recdata, model, method = "kernel", SE = FALSE,
  bandwidth = NULL, low = 0, up = NULL, tau = NULL, nb = 50)

Arguments

formula

a formula object. The left side of the operator '~' should be the time variable in the dataset. The right side should be the terms: for the proportional rates model and the additive rates model, the covariates included in the model are simply connected by '+'; for the additive-multiplicative rates model, the covariates included in the multiplicative part come first and are separated from the covarites included in the additive part by '|'. See the 'Examples' for details.

recdata

is the rectime data object generated from the recdata() function.

model

the regression model to fit the data. Possible choices include: "prop" for the proportional rates model; "add" for the additive rates model; "add-mul" for the additive-multiplicative rates model.

method

the method to deal with the intermittently observed time-dependent covariates. Possible choices include: "kernel" for the kernel smoothing method; "ACCF" for the last covariate carry forward method; "interp" for the linear interpolation method. The default is "kernel".

SE

is TRUE then the standard error estimated by bootstrap is returned. The default is FALSE.

bandwidth

the bandwidth used in the "kernel" method. If left unspecified, the bandiwidth will be chosen automatically. See 'Details' for more information.

low

the lower bound of the interval for the searching of the constant 'C' for the automatically chosen bandwidth 'C*N^(-1/3)'. If left unpecified, the default is 0.

up

the upper bound of the interval for the searching of the constant 'C' for the automatically chosen bandwidth 'C*N^(-1/3)'. If left unpecified, the default is tau.

tau

the pre-specified time point such that the recurrent event process could be potentially observed beyond tau. Usually it is the length of the study. If left unspecified, the default is the maximum of the time variable.

nb

the resampling size of bootstrap. The default is 50.

Details

When there are missing values in the covariates included in the model: for d.event, the whole subject will be deleted if at least one covariate is missing in one observation; for d.regular, only the observation with missing covariate values will be deleted.

Examples

1
2
3
4
5
6
7
8
data(simdata)
recd <- recdata(id="id", type="type", time="time", data=simdata)
#proportional rates model
rectime(time~z1+z2, recdata=recd, model="prop", method="kernel",bandwidth=1)
#additive rates model
rectime(time~z1+z2, recdata=recd, model="add", method="kernel",bandwidth=1)
#additive-multiplicative rates model
rectime(time~z1|z2, recdata=recd, model="add-mul", method="kernel",bandwidth=1)

TianmengL/rectime documentation built on June 5, 2021, 8:29 p.m.