predict.tsriadditive: Predict method for Additive Hazards Model with Two Stage...

Description Usage Arguments Value Examples

View source: R/tsriadditive.R

Description

Predicted values based on tsriadditive object.

Usage

1
2
3
## S3 method for class 'tsriadditive'
predict(object, newtreatment = NULL,
  newIV = NULL, newcovariates = NULL, ...)

Arguments

object

an object of class "tsriadditive", usually, a result of a call to tsriadditive.

newtreatment

a new treatment value.

newIV

a new instrumental variable value.

newcovariates

a new observed covariates.

...

further arguments passed to or from other methods.

Value

predict.tsriadditive produces a venctor of predictions based on new values. A list with the following components is returned:

newobsz

the vector grouping newtreatment, new IV and newcovariates

score_pred

the predicted scores

hazard_pred

the predicted baseline hazards function

surival_pred

the predicted surival function

Examples

1
2
3
4
5
6
7
survtime <- rexp(100)
cause <- rbinom(100, 1, 0.7)
treatment <- rbinom(100, 1, 0.5)
IV <- rnorm(100)
covariates <- rnorm(100)
fit <- tsriadditive(survtime, cause, treatment, IV, covariates)
predict(fit, 1, 0, 0)

tsriadditive documentation built on April 28, 2020, 5:10 p.m.