add likelihood for a BrS measurement slice among cases (conditional dependence) | add_meas_BrS_case_Nest_Slice |
add likelihood for a BrS measurement slice among cases (conditional dependence) | add_meas_BrS_case_Nest_Slice_jags |
add likelihood component for a BrS measurement slice among cases | add_meas_BrS_case_NoNest_reg_discrete_predictor_Slice_jags |
add likelihood component for a BrS measurement slice among cases | add_meas_BrS_case_NoNest_reg_Slice_jags |
add a likelihood component for a BrS measurement slice among cases (conditional independence) | add_meas_BrS_case_NoNest_Slice |
add a likelihood component for a BrS measurement slice among cases (conditional independence) | add_meas_BrS_case_NoNest_Slice_jags |
add likelihood for a BrS measurement slice among controls (conditional independence) | add_meas_BrS_ctrl_Nest_Slice |
add a likelihood component for a BrS measurement slice among controls | add_meas_BrS_ctrl_NoNest_reg_discrete_predictor_Slice_jags |
add a likelihood component for a BrS measurement slice among controls | add_meas_BrS_ctrl_NoNest_reg_Slice_jags |
add a likelihood component for a BrS measurement slice among controls (conditional independence) | add_meas_BrS_ctrl_NoNest_Slice |
add parameters for a BrS measurement slice among cases and controls | add_meas_BrS_param_Nest_reg_Slice_jags |
add parameters for a BrS measurement slice among cases and controls (conditional dependence) | add_meas_BrS_param_Nest_Slice |
add parameters for a BrS measurement slice among cases and controls (conditional dependence) | add_meas_BrS_param_Nest_Slice_jags |
add parameters for a BrS measurement slice among cases and controls | add_meas_BrS_param_NoNest_reg_discrete_predictor_Slice_jags |
add parameters for a BrS measurement slice among cases and controls | add_meas_BrS_param_NoNest_reg_Slice_jags |
add parameters for a BrS measurement slice among cases and controls (conditional independence) | add_meas_BrS_param_NoNest_Slice |
add parameters for a BrS measurement slice among cases and controls (conditional independence) | add_meas_BrS_param_NoNest_Slice_jags |
add subclass indicators for a BrS measurement slice among cases and controls (conditional independence) | add_meas_BrS_subclass_Nest_Slice |
add likelihood for a SS measurement slice among cases (conditional independence) | add_meas_SS_case |
add parameters for a SS measurement slice among cases (conditional independence) | add_meas_SS_param |
convert one column data frame to a vector | as.matrix_or_vec |
Interpret the specified model structure | assign_model |
baker: *B*ayesian *A*nalytic *K*it for *E*tiology *R*esearch | baker |
Pick parameters in the Beta distribution to match the specified range | beta_parms_from_quantiles |
Plot beta density | beta_plot |
Convert a 0/1 binary-coded sequence into decimal digits | bin2dec |
check existence and create folder if non-existent | check_dir_create |
Combine subsites in raw PERCH data set | clean_combine_subsites |
Clean PERCH data | clean_perch_data |
combine multiple data_nplcm (useful when simulating data from regression models) | combine_data_nplcm |
Calculate marginal log odds ratios | compute_logOR_single_cause |
compute positive rates for nested model with subclass mixing weights that are the same across 'Jcause' classes for each person (people may have different weights.) | compute_marg_PR_nested_reg |
compute positive rates for nested model with subclass mixing weights that are the same across 'Jcause' classes for each person (people may have different weights.) | compute_marg_PR_nested_reg_array |
create regressor summation equation used in regression for etiology | create_bugs_regressor_Eti |
create regressor summation equation used in regression for FPR | create_bugs_regressor_FPR |
Simulated dataset that is structured in the format necessary for an 'nplcm()' without regression | data_nplcm_noreg |
Simulated dataset that is structured in the format necessary for an 'nplcm()' with regression | data_nplcm_reg_nest |
Deletes a pattern from the start of a string, or each of a vector of strings. | delete_start_with |
Make etiology design matrix for dates with R format. | dm_Rdate_Eti |
Make FPR design matrix for dates with R format. | dm_Rdate_FPR |
expit function | expit |
Import Raw PERCH Data 'extract_data_raw' imports and converts the raw data to analyzable format | extract_data_raw |
Obtain coverage status from a result folder | get_coverage |
Obtain direct bias that measure the discrepancy of a posterior distribution of pie and a true pie. | get_direct_bias |
get fitted mean for nested model with subclass mixing weights that are the same among cases | get_fitted_mean_nested |
get model fitted mean for conditional independence model | get_fitted_mean_no_nested |
get individual data | get_individual_data |
get individual prediction (Bayesian posterior) | get_individual_prediction |
get index of latent status | get_latent_seq |
get marginal TPR and FPR for nested model | get_marginal_rates_nested |
get marginal TPR and FPR for no nested model | get_marginal_rates_no_nested |
Obtain Integrated Squared Aitchison Distance, Squared Bias and Variance (both on Central Log-Ratio transformed scale) that measure the discrepancy of a posterior distribution of pie and a true pie. | get_metric |
get etiology samples by names (no regression) | get_pEti_samp |
get the plotting positions (numeric) for the fitted means; 3 positions for each cell | get_plot_num |
get a list of measurement index where to look for data | get_plot_pos |
Obtain posterior standard deviation from a result folder | get_postsd |
get top patterns from a slice of bronze-standard measurement | get_top_pattern |
Shannon entropy for multivariate discrete data | H |
test if a formula has terms not created by [s_date_Eti() or 's_date_FPR()' | has_non_basis |
Convert 0/1 coding to pathogen/combinations | I2symb |
Convert a matrix of binary indicators to categorical variables | Imat2cat |
Initialize individual latent status (for 'JAGS') | init_latent_jags_multipleSS |
insert distribution for latent status code chunk into .bug file | insert_bugfile_chunk_noreg_etiology |
Insert measurement likelihood (without regression) code chunks into .bug model file | insert_bugfile_chunk_noreg_meas |
insert etiology regression for latent status code chunk into .bug file; discrete predictors | insert_bugfile_chunk_reg_discrete_predictor_etiology |
Insert measurement likelihood (with regression; discrete) code chunks into .bug model file | insert_bugfile_chunk_reg_discrete_predictor_nonest_meas |
insert etiology regression for latent status code chunk into .bug file | insert_bugfile_chunk_reg_etiology |
Insert measurement likelihood (nested model+regression) code chunks into .bug model file | insert_bugfile_chunk_reg_nest_meas |
Insert measurement likelihood (with regression) code chunks into .bug model file | insert_bugfile_chunk_reg_nonest_meas |
Check if covariates are discrete | is_discrete |
check if the formula is intercept only | is_intercept_only |
See if a result folder is obtained by JAGS | is_jags_folder |
check if a list has elements all of length one | is_length_all_one |
Test for 'try-error' class | is.error |
Run 'JAGS' from R | jags2_baker |
convert line to user coordinates | line2user |
load an object from .RDATA file | loadOneName |
logit function | logit |
calculate pairwise log odds ratios | logOR |
log sum exp trick | logsumexp |
Get position to store in data_nplcm$Mobs: | lookup_quality |
Create new file name | make_filename |
Create new folder name | make_foldername |
Takes any number of R objects as arguments and returns a list whose names are derived from the names of the R objects. | make_list |
Make measurement slice | make_meas_object |
Make a list with numbered names | make_numbered_list |
make a mapping template for model fitting | make_template |
Shannon entropy for binary data | marg_H |
Match latent causes that might have the same combo but different specifications | match_cause |
For a list of many sublists each of which has matrices as its member, we combine across the many sublists to produce a final list | merge_lists |
Reorder the measurement dimensions to match the order for display | my_reorder |
convert 'NA' to '.' | NA2dot |
Fit nested partially-latent class models (highest-level wrapper function) | nplcm |
Fit nested partially-latent class model (low-level) | nplcm_fit_NoReg |
Fit nested partially-latent class model with regression (low-level) | nplcm_fit_Reg_discrete_predictor_NoNest |
Fit nested partially-latent class model with regression (low-level) | nplcm_fit_Reg_Nest |
Fit nested partially-latent class model with regression (low-level) | nplcm_fit_Reg_NoNest |
Read data and other model information from a folder that stores model results. | nplcm_read_folder |
Convert 'NULL' to zero. | null_as_zero |
order latent status by posterior mean | order_post_eti |
specify overall uniform (symmetric Dirichlet distribution) for etiology prior | overall_uniform |
parse regression components (either false positive rate or etiology regression) for fitting npLCM; Only use this when formula is not 'NULL'. | parse_nplcm_reg |
pathogens and their categories in PERCH study (virus or bacteria) | pathogen_category_perch |
Hypothetical pathogens and their categories (virus or bacteria) | pathogen_category_simulation |
Plot bronze-standard (BrS) panel | plot_BrS_panel |
visualize the PERCH etiology regression with a continuous covariate | plot_case_study |
Posterior predictive checking for the nested partially class models - frequent patterns in the BrS data. (for multiple folders) | plot_check_common_pattern |
Posterior predictive checking for nested partially latent class models - pairwise log odds ratio (only for bronze-standard data) | plot_check_pairwise_SLORD |
visualize the etiology regression with a continuous covariate | plot_etiology_regression |
visualize the etiology estimates for each discrete levels | plot_etiology_strat |
plotting the labels on the left margin for panels plot | plot_leftmost |
Visualize pairwise log odds ratios (LOR) for data that are available in both cases and controls | plot_logORmat |
Plot three-panel figures for nested partially-latent model results | plot_panels |
Plot etiology (pie) panel | plot_pie_panel |
Plot silver-standard (SS) panel | plot_SS_panel |
visualize the subclass weight regression with a continuous covariate | plot_subwt_regression |
'plot.nplcm' plot the results from 'nplcm()'. | plot.nplcm |
'print.nplcm' summarizes the results from 'nplcm()'. | print.nplcm |
Compact printing of 'nplcm()' model fits | print.summary.nplcm.no_reg |
Compact printing of 'nplcm()' model fits | print.summary.nplcm.reg_nest |
Compact printing of 'nplcm()' model fits | print.summary.nplcm.reg_nest_strat |
Compact printing of 'nplcm()' model fits | print.summary.nplcm.reg_nonest |
Compact printing of 'nplcm()' model fits | print.summary.nplcm.reg_nonest_strat |
Read measurement slices | read_meas_object |
Sample a vector of Bernoulli variables. | rvbern |
Make Etiology design matrix for dates with R format. | s_date_Eti |
Make false positive rate (FPR) design matrix for dates with R format. | s_date_FPR |
Set true positive rate (TPR) prior ranges for bronze-standard (BrS) data | set_prior_tpr_BrS_NoNest |
Set true positive rate (TPR) prior ranges for silver-standard data. | set_prior_tpr_SS |
Stratification setup by covariates | set_strat |
Show function dependencies | show_dep |
get an individual's data from the output of 'clean_perch_data()' | show_individual |
Simulate Bronze-Standard (BrS) Data | simulate_brs |
Simulate Latent Status: | simulate_latent |
Simulate data from nested partially-latent class model (npLCM) family | simulate_nplcm |
Simulate Silver-Standard (SS) Data | simulate_ss |
softmax | softmax |
subset data from the output of 'clean_perch_data()' | subset_data_nplcm_by_index |
summarize bronze-standard data | summarize_BrS |
silver-standard data summary | summarize_SS |
'summary.nplcm' summarizes the results from 'nplcm()'. | summary.nplcm |
get symmetric difference of months from two vector of R-format dates | sym_diff_month |
Convert names of pathogen/combinations into 0/1 coding | symb2I |
generate stick-breaking prior (truncated) from a vector of random probabilities | tsb |
Convert factor to numeric without losing information on the label | unfactor |
get unique causes, regardless of the actual order in combo | unique_cause |
Get unique month from Date | unique_month |
Visualize matrix for a quantity measured on cases and controls (a single number) | visualize_case_control_matrix |
visualize trend of pathogen observation rate for NPPCR data (both cases and controls) | visualize_season |
Write .bug model file for model without regression | write_model_NoReg |
Write .bug model file for regression model without nested subclasses | write_model_Reg_discrete_predictor_NoNest |
Write '.bug' model file for regression model WITH nested subclasses | write_model_Reg_Nest |
Write .bug model file for regression model without nested subclasses | write_model_Reg_NoNest |
function to write bugs model (copied from R2WinBUGS) | write.model |