Learn R Programming

pseval (version 1.3.1)

add_riskmodel: Add risk model to a psdesign object

Description

Add risk model to a psdesign object

Usage

add_riskmodel(psdesign, riskmodel)

Arguments

psdesign

A psdesign object

riskmodel

A risk model object, from the list above

Details

The risk model component specifies the likelihood for the data. This involves specifying the distribution of the outcome variable, whether it is binary or time-to-event, and specifying how the surrogate S(1) and the treatment Z interact and affect the outcome. We use the formula notation to be consistent with other regression type models in R. Below is a list of available risk models.

  • risk_binary This is a generic risk model for binary outcomes. The user can specify the formula, and link function using either risk.logit for the logistic link, or risk.probit for the probit link. Custom link functions may also be specified, which take a single numeric vector argument, and returns a vector of corresponding probabilities.

  • risk_weibull This is a parameterization of the Weibull model for time-to-event outcomes that is consistent with that of rweibull. The user specifies the formula for the linear predictor of the scale parameter.

  • risk_exponential This is a simple exponential model for a time-to-event outcome.

  • risk_poisson This is a Poisson model for count outcomes. It allows for offsets in the formula.

  • risk_continuous This is a Gaussian model for continuous outcomes. It assumes that larger values of the outcome are harmful (e.g. blood pressure)

Examples

Run this code
# NOT RUN {
test <- psdesign(generate_example_data(n = 100), Z = Z, Y = Y.obs, S = S.obs, BIP = BIP) +
     integrate_parametric(S.1 ~ BIP)
add_riskmodel(test, risk_binary())
test + risk_binary() # same as above
# }

Run the code above in your browser using DataLab