# \donttest{
# Obtain the indexing parameters for the combination of albumin and bilirubin markers
# These are the values used in the example of function h_xt_vec
# and yielded the values: (par.alb, par.bil) = ( 0.0702, 0.0856 ) that were used there.
I = 26
b_list = seq(1.1, 1.2, by=0.1)
for(i in 1:length(b_list))
{
res<- optim(c(0.5, 0.5), b_selection_index_optim, data=pbc2, marker_name1='albumin',
marker_name2= 'serBilir', event_time_name = 'years', time_name = 'year',
event_name = 'status2', I=26, b=b_list[i], method="Nelder-Mead")
cat("i= ", i, " ", res$par, " ", res$value, "count calls to fn = ", res$counts, " converge? ",
res$convergence, "\n")
res
}
# }
Run the code above in your browser using DataLab