# predictions for threshold regression model

### Description

This function can be used to predict the initial health status value *y_0*, the drift value of the health process *μ*, the probability density function of the survival time *f(t\mid μ,y_0)*, the survival function *S(t\mid μ, y_0)* and the hazard function *h(t\mid μ,y_0)* for a specified scenario and time value. The scenario specified here is similar to those in hr.threg and plot.threg functions. The only difference is that we need to provide the scenario values for all variables in the model, while for hr.threg and plot.threg functions we do not need to provide scenario values of the dummy variables expanded from the factor variable specified in the var argument.

### Usage

1 2 |

### Arguments

`object` |
a threg object. |

`timevalue` |
specifies the desired time value at which the predicted values are to be calculated. Vector is allowed for this argument. If this argument is omitted, then the predicted values for the study time of all subjects would be calculated. |

`scenario` |
specifies the values of all predictors. If this argument is omitted, then the predicted values at a specified time value for all subjects would be calculated, and in this case the covariate values for each subject are used as their corresponding scenario values. |

`...` |
for future methods |

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
#load the data "bmt"
data("bmt")
#Transform the "group" and "fab" variables into factor variables
#"f.group" and "f.fab".
bmt$f.group=factor(bmt$group)
bmt$f.fab=factor(bmt$fab)
#fit a threshold regression model on the "bmt" dataset, by using "recipient_age" and
#"f.fab" as the predictors for ln(y0), and "f.group" and "f.fab" as predictors for mu.
fit<-threg(Surv(time, indicator)~ recipient_age+f.fab|f.group+f.fab, data = bmt)
#predict lny0, y0, mu, f, S and h for the specified scenario that "the patient age is
#18 years old, the FAB classification is 0 and the risk category is 3", at the
#time ``2000 days''
predict.threg(fit,timevalue=2000,scenario=recipient_age(18)+f.fab1(0)+f.group2(0)+f.group3(1))
``` |