## Load simulated data
data(SimulatedData)
attach(SimulatedData)
y = SimulatedData$y
t = SimulatedData$t
id = SimulatedData$id
X = SimulatedData[,4:103]
## Fit frequentist penalized NVC model with the group lasso penalty.
## No need to specify an 'id' argument when using NVC_frequentist() function.
NVC_gLASSO_mod = NVC_frequentist(y=y, t=t, X=X, penalty="gLASSO")
## Make in-sample predictions. Here, we DO need to specify 'id' argument
NVC_gLASSO_predictions = NVC_predict(NVC_gLASSO_mod, t_new=t, id_new=id, X_new=X)
## Subjects
NVC_gLASSO_predictions$id
## Observation times
NVC_gLASSO_predictions$time
## Predicted responses
NVC_gLASSO_predictions$y_pred
# \donttest{
## Fit NVC-SSL model to the data instead. Here, we do need to specify id
NVC_SSL_mod = NVC_SSL(y=y, t=t, id=id, X=X)
NVC_SSL_predictions = NVC_predict(NVC_SSL_mod, t_new = t, id_new=id, X_new=X)
## Subjects
NVC_SSL_predictions$id
## Observation times
NVC_SSL_predictions$time
## Predicted responses
NVC_SSL_predictions$y_pred
# }
Run the code above in your browser using DataLab