Description Usage Arguments Value Examples

Fit a Bayesian Dirichlet regression model that optionally includes covariates to estimate effects of factor or continuous variables on proportions.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 |

`formula` |
The model formula for the design matrix. Does not need to have a response specified. If =NULL, then the design matrix is ignored and all rows are treated as replicates |

`design_matrix` |
A data frame, dimensioned as number of observations, and covariates in columns |

`data_matrix` |
A matrix, with observations on rows and number of groups across columns |

`chains` |
Number of mcmc chains, defaults to 3 |

`iter` |
Number of mcmc iterations, defaults to 2000 |

`warmup` |
Number iterations for mcmc warmup, defaults to 1/2 of the iterations |

`overdispersion` |
Whether or not to include overdispersion parameter, defaults to FALSE |

`overdispersion_sd` |
Prior standard deviation on 1/overdispersion parameter, Defaults to inv-Cauchy(0,5) |

`posterior_predict` |
Whether or not to return draws from posterior predictive distribution (requires more memory) |

`moment_match` |
Whether to do moment matching via |

`prior_sd` |
Parameter to be passed in to use as standard deviation of the normal distribution in transformed space. If covariates are included this defaults to 1, but for models with single replicate, defaults to 1/n_bins. |

`...` |
Any other arguments to pass to |

A list containing the fitted model and arguments and data used
to fit the model. These include `model`

(the fitted model object of class `stanfit`

),
`par_names`

(the names of monitored parameters), `design_matrix`

(the
design matrix of covariates), `data_matrix`

(the data matrix of responses),
`overdispersion`

(boolean, whether overdispersion was used),
`overdispersion_prior`

(the prior used for overdispersion),
and `posterior_predict`

(boolean, whether posterior prediction was done)

1 2 3 4 5 6 7 8 9 | ```
y <- matrix(c(3.77, 6.63, 2.60, 0.9, 1.44, 0.66, 2.10, 3.57, 1.33),
nrow = 3, byrow = TRUE
)
# fit a model with no covariates
fit <- fit_zoid(data_matrix = y)
# fit a model with 1 factor
design <- data.frame("y" = c(1, 1, 1), "fac" = c("spring", "spring", "fall"))
fit <- fit_zoid(formula = ~fac, design_matrix = design, data_matrix = y)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.