Parametric Results"

knitr::opts_chunk$set(echo=FALSE, warning=FALSE, message=FALSE,
                      fig.pos = 'H',
                      fig.align = 'center',
                      fig.height = 6,
                      fig.width = 10)
library("expertsurv")
library("ggpubr")
params$surv_plt
params$gof_plt
if(params$opinion_type != "no_expert"){

  surv_expert <- list()

  for(i in 1:params$n_timepoint){
          surv_expert[[i]] <- params[[paste0("expert_plot",i)]] 
  }

ggpubr::ggarrange(plotlist=surv_expert,
                      #labels = ,
                      ncol = 1, nrow = params$n_timepoint)


}

Parameter Results

  #https://stackoverflow.com/questions/69935356/r-markdown-use-for-loop-to-generate-text-and-display-figure-table

for(i in 1:length(fit$models)){
    cat("### Parameter Values ", names(fit$models)[i], "\n")
  if(fit$method =="mle"){
    df_mod <- do.call(expertsurv:::get_stats_mle, args = list(fit,mod =i ))
  }else{
    df_mod <- do.call(expertsurv:::get_stats_hmc, args = list(fit,mod =i))
  }

  tb_mod <- knitr::kable(df_mod, caption = paste0("Table ",names(fit$models)[i]),digits = 3)
  cat("\n")
  print(tb_mod)
  cat("\n")

}


Try the expertsurv package in your browser

Any scripts or data that you put into this service are public.

expertsurv documentation built on Oct. 5, 2023, 5:09 p.m.