<jupyter_start><jupyter_text>Figure 1<jupyter_code># check model fit
fig_posterior = plot_posterior_diagnostic(dat, optimal_model)$figure 
fig_posterior
# identify outliers
fig_looic = plot_k_diagnostic(dat, optimal_model)$figure
fig_looic
# examine outliers
fig_outlier1 = plot_obs_predict(sfpca_data=dat, optimal_model=optimal_model, data=df, 
                 time_name = 'timepoint', response_name = 'shannon_avg', 
                 unique_subject_id = 'ID_unique', subject_selected='Volunteer 9Armpit',
                 x_lab='Weeks', y_lab='Shannon diversity', 
                 title='Outlier 46: observed vs. fitted', legend_show=FALSE,
                 x_axis_ticks=seq(0,8,2), x_axis_range=c(0,8), 
                 y_axis_ticks=seq(0,8,2), y_axis_range=c(0,8))$figure
fig_outlier1
fig_outlier2 =  plot_obs_predict(sfpca_data=dat, optimal_model=optimal_model, data=df, 
                 time_name = 'timepoint', response_name = 'shannon_avg', 
                 unique_subject_id = 'ID_unique', subject_selected='Volunteer 6Foot',
                 x_lab='Weeks', y_lab='Shannon diversity', 
                 title='Outlier 36: observed vs. fitted', legend_show=FALSE,
                 x_axis_ticks=seq(0,8,2), x_axis_range=c(0,8), 
                 y_axis_ticks=seq(0,8,2), y_axis_range=c(0,8))$figure
fig_outlier2
plot_grid(fig_posterior, fig_looic, 
          fig_outlier1 , 
          fig_outlier2 ,
          labels = c('A', 'B', 'C', 'D'), 
          hjust = 0, vjust = 1, ncol=2) 
ggsave('application_fig1.png', width=8, height=8, dpi=300)<jupyter_output>Warning message:
“Removed 4 rows containing missing values (geom_point).”
Warning message:
“Removed 4 row(s) containing missing values (geom_path).”
Warning message:
“Removed 4 rows containing missing values (geom_point).”
Warning message:
“Removed 4 row(s) containing missing values (geom_path).”<jupyter_text>figure 2<jupyter_code>fig_mean = plot_mean_curve(output = model_output, original=T, 
                ymin=0.5, ymax=8, x_lab='Weeks', y_lab='Shannon diversity')$figure
fig_fpc = plot_fpc_curve(output = model_output, pc_idx=c(1,2,3,4), ymin=2, ymax=7.5,
               original=T, x_lab='Weeks', y_lab='Shannon diversity')$figure
fig_fpc
fig_pc1 = plot_fpc_on_mean_curve(output = model_output, pc_idx=1, original = T, sd=T, 
                       x_lab='Weeks', y_lab='Shannon diversity', ymin=0.5, ymax=8)$figure
fig_pc1
fig_pc2 = plot_fpc_on_mean_curve(output = model_output, pc_idx=2, original = T, sd=T,
                       x_lab='Weeks', y_lab='Shannon diversity', ymin=0.5, ymax=8)$figure
fig_pc2
fig_score_pc1 = plot_fpc_boxplot(output = model_output, pc_idx=1, group_name = 'sample_site',
                 x_lab = 'Body site', y_lab = 'Score of the first PC', p_title='Shannon diversity',
                 testing_type = 'non-parametric', pairwise_testing=F)$figure 
fig_score_pc2 = plot_fpc_boxplot(output = model_output, pc_idx=2, group_name = 'sample_site',
                 x_lab = 'Body site', y_lab = 'Score of the second PC', p_title='Shannon diversity',
                 testing_type = 'non-parametric', pairwise_testing=F, pval_show_all=T)$figure 
plot_grid(fig_mean, fig_fpc, 
          fig_pc1, fig_pc2,
          fig_score_pc1, fig_score_pc2,
          labels = c('A', 'B', 'C', 'D', 'E', 'F'), 
          hjust = 0, vjust = 1, ncol=2) 
ggsave('application_fig2.png', width=7, height=10, dpi=300)<jupyter_output>Warning message:
“Removed 448 row(s) containing missing values (geom_path).”
{'fraction_non_alphanumeric': 0.12256586483390607, 'fraction_numerical': 0.02577319587628866, 'mean_word_length': 3.6823056300268098, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '599194', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1226, 'n_words': 239, 'path': 'applications/notebook_skin_microbiome_applications.ipynb', 'repo_name': 'serenejiang/BayesTime-analyses', 'size': '3492'}