Description Usage Arguments Author(s) References Examples
Extend right-censored data of Xiao et al. (2015) into interval-censored data. Fit a threshold regression model for interval-censored data and calculate the prediction of the initial health status value and the drift value of the health process.
1 |
formula |
a formula object, which has the response on the left of a ~ operator, and the explaination variables on the right. The response must be a survival object as returned by the Surv(). The | operator on the left-hand side is used for the linear regression function of ln{y_0} and right-hand side is for specifing explaination variables of μ. A constant ln{y_0} or μ is allowed, let 0 or 1 as a placeholder on the left or right of the | operator. |
data |
a data frame must contains two time points (L and R) in which to through the Surv() of R package survival by type = interval2 and interpret the variables named in the formula. |
Man-Hua Chen
Maintainer: Man-Hua Chen < mchen@tku.edu.tw >
Xiao T, Whitmore GA, He X and Lee M-LT. (2015) The R Package threg to Implement Threshold Regression Models. Journal of Statistical Software 66, 1141-1156.
Xiao T. (2013) threg: Threshold Regression. R~package version 1.0.3, URL https://CRAN.R-project.org/package=threg.
1 2 3 4 5 6 7 8 9 | #load the data "bcos"
data("bcos", package="thregI")
#transform the "treatment" variable into factor variable f.treatment
bcos$f.treatment=factor(bcos$treatment)
#fit the threshold regression model on the factor variable f.treatment
fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment, data=bcos)
fit
|
Loading required package: survival
Loading required package: Formula
There were 50 or more warnings (use warnings() to see the first 50)
Call:
thregI(formula = Surv(left, right, type = "interval2") ~ f.treatment |
f.treatment, data = bcos)
coef se(coef) z p
lny0: (Intercept) 1.9958221 0.12448643 16.032447 0.0e+00
lny0: f.treatmentRadiation -0.4366409 0.19479511 -2.241539 2.5e-02
mu: (Intercept) -0.2794762 0.05443711 -5.133927 2.8e-07
mu: f.treatmentRadiation 0.2641738 0.07162263 3.688412 2.3e-04
Log likelihood =-142.39, AIC =292.79
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.