Functions in paramedic
expect data (W, V, and X) in matrix, data.frame
, or tibble form, with the first column being sample identifiers.
Sample identifiers must be the same between W, V, and X and the column must
have the same name in W and V. This function checks the incoming data,
transforms it into the data list that is passed to the Stan functions, and
computes any initial values of model parameters.
check_entered_data(
W,
V,
X,
k,
inits_lst,
sigma_beta,
sigma_Sigma,
alpha_sigma,
kappa_sigma
)
make_paramedic_tibbles(
W,
V,
X,
k,
inits_lst,
sigma_beta,
sigma_Sigma,
alpha_sigma,
kappa_sigma
)
make_paramedic_stan_data(
k,
W_mat,
V_mat,
X_mat,
inits_lst,
sigma_beta,
sigma_Sigma,
alpha_sigma,
kappa_sigma,
alpha_phi,
beta_phi,
n_chains,
centered = FALSE
)
The relative abundance data, e.g., from broad range 16S sequencing with "universal" primers. Expects data (e.g., matrix, data.frame, tibble) with sample identifiers in the first column. Sample identifiers must be the same between W and V, and the column must have the same name in W and V.
The absolute abundance data, e.g., from taxon-specific absolute primers. Expects data (e.g., matrix, data.frame, tibble) with sample identifiers in the first column. Sample identifiers must be the same between W and V, and the column must have the same name in W and V.
The covariate data. Expects data (e.g., matrix, data.frame, tibble) with sample identifiers in the first column. Sample identifiers must be the same between W, V, and X, and the column must have the same name in W, V, and X. If X only consists of the subject identifiers, then no covariates are used.
the number of batches (0 if a single batch)
An optional list of initial values of the parameters.
Must be a named list; see stan
.
Hyperparameter specifying the prior variance on \(\beta_0\). Defaults to \(\sqrt{50}\).
Hyperparameter specifying the prior variance on \(\Sigma\). Defaults to \(\sqrt{50}\).
Hyperparameter specifying the shape parameter of the prior distribution on \(\sigma_e\). Defaults to 2.
Hyperparameter specifying the scale parameter of the prior distribution on \(\sigma_e\). Defaults to 1.
the pre-processed matrix W
the pre-processed matrix V
the pre-processed matrix X
Hyperparameter specifying the shape parameter of the prior distribution on \(phi\) (the optional Negative Binomial dispersion parameter). Defaults to 0 (in which case a Poisson distribution on V is used).
Hyperparameter specifying the scale parameter of the prior distribution on \(phi\) (the optional Negative Binomial dispersion parameter). Defaults to 0 (in which case a Poisson distribution on V is used).
the number of chains to run
whether or not to use the centered parameterization of the
stan algorithm. Defaults to FALSE
.
make_paramedic_tibbles
: Make tibbles from entered data
make_paramedic_stan_data
: Make data and initial values lists to
pass to stan