Learn R Programming

carx (version 0.7.1)

carx.formula: A formula interface to the carx method

Description

This interface uses the supplied formula and data provided by data and other arguments in ... to invoke the carx.default method. This is the preferred way of calling the carx.default function.

Usage

# S3 method for formula
carx(formula, data = list(), ...)

Arguments

formula

a formula representing the regression part of the model, such as y ~ x1 + x2.

data

a list, data.frame, or a cenTS object which includes the following:

  • the response variable with variable name identified by the supplied formula.

  • any covariate(s) with with variable name(s) identified by the supplied formula.

  • ci whose components take values from -1, 0, 1, where -1 (0,1) indicates that the corresponding element in the response variable is left-censored (not censored, right censored).

  • lcl which denotes the vector of left (lower) censoring limits.

  • ucl which denotes the vector of right (upper) censoring limits.

...

other parameters accepted by carx.default except y, x, ci, lcl, and ucl.

Value

a CARX object of the estimated model.

See Also

carx.default for more options.

cenTS on how to construct a cenTS object.

Examples

Run this code
# NOT RUN {
dat = carxSim(nObs=100,seed=0)
mdl <- carx(y~X1+X2-1,data=dat, p=2, CI.compute = FALSE)
# }

Run the code above in your browser using DataLab