Package: power.nb 0.1.0

Michael Agronah

power.nb: Power and Sample Size Calculation for Differential Abundance Microbiome Studies

Provides functions for estimating statistical power and required sample sizes in differential abundance microbiome studies using negative binomial models. The methods are based on Agronah and Bolker (2025) <doi:10.1371/journal.pone.0318820>. The package includes tools for simulation-based power analysis and sample size estimation using generalized additive models (GAMs), and visualization utilities for exploring the relationship between power, effect size, abundance, and sample size.

Authors:Michael Agronah [aut, cre], Ben Bolker [aut]

power.nb_0.1.0.tar.gz
power.nb_0.1.0.tar.gz(r-4.7-any)power.nb_0.1.0.tar.gz(r-4.6-any)
power.nb_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
power.nb/json (API)
NEWS

# Install 'power.nb' in R:
install.packages('power.nb', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/magronah/power.nb/issues

Pkgdown/docs site:https://michaelagronah.com

On CRAN:

Conda:

2.70 score 1 scripts 25 exports 134 dependencies

Last updated from:82f9ba0273. Checks:4 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK300
source / vignettesOK380
linux-release-x86_64OK297
wasm-releaseOK196

Exports:contour_plot_funcountdata_sim_fundeseq_fun_estdeseqfundispersion_fitdispersion_fundnormmixdnormmix0filter_low_countgam_fitgen_parnamesgenmixparslogfoldchange_fitlogfoldchange_sim_funlogmean_fitlogmean_sim_funmyrnormmixoptimal.comppolyfunpower_fun_ssread_datarnormmix0sample_size_ss_interpss_solveruniroot_ss

Dependencies:abindaskpassbackportsbase64encbeeswarmBHBiobaseBiocGenericsBiocParallelbslibcachemCairocheckmateclassclassIntclicodetoolscpp11crosstalkcurldata.tableDBIDelayedArrayDEoptimDESeq2digestdoParalleldplyre1071evaluatefarverfastmapfitdistrplusfontawesomeforeachformatRFormulaformula.toolsfsfutile.loggerfutile.optionsgenericsGenomicRangesggbeeswarmggplot2ggrastrgluegtablehighrhtmltoolshtmlwidgetshttrIRangesisobanditeratorsjquerylibjsonlitekernlabKernSmoothknitrlabelinglambda.rlaterlatex2explatticelazyevallifecyclelocfitlubridatemagrittrMASSMatrixMatrixGenericsmatrixStatsmemoisemetRmgcvmimeminpack.lmmixtoolsnlmeopenssloperator.toolsotelpillarpkgconfigplotlyplyrpngpromisesproxypurrrR6raggrappdirsRColorBrewerRcppRcppArmadillorlangrmarkdowns2S4ArraysS4VectorsS7sassscalesscamsegmentedSeqinfosfsnowSparseArraystringistringrSummarizedExperimentsurvivalsyssystemfontstextshapingtibbletidyrtidyselecttimechangetinytexunitsutf8vctrsviporviridisLitewithrwkxfunXVectoryaml

Power and Sample Size Estimation for Microbiome Analysis

Rendered fromstub.rmdusingknitr::rmarkdownon Jun 15 2026.

Last update: 2026-06-15
Started: 2026-06-15

Readme and manuals

Help Manual

Help pageTopics
Contour plot for showing predicted powercontour_plot_fun
Simulate Count Data for Microbiome Studiescountdata_sim_fun
Fold change and p-value estimations for simulationsdeseq_fun_est
Estimate log fold changes using 'DESeq2'.deseqfun
Fit the non-linear function to dispersion estimatesdispersion_fit
Calculate Dispersion for Microbiome Datadispersion_fun
Density of a Normal Mixture Modeldnormmix
Density function for the mixture of Gaussian distributionsdnormmix0
Filter to remove low abundant taxafilter_low_count
Titlegam_fit
Generate Parameter Names for Mixture Modelgen_parnames
generate normal mixture parameters (prob vector, mean vector, sd vector for a specified set of 'x' values (logmean)genmixpars
Fit a mixture of Gaussian distributions to log fold changelogfoldchange_fit
Simulate Log Fold Change Valueslogfoldchange_sim_fun
Fit a mixture of Gaussian Distributions to log mean count of taxa.logmean_fit
Simulate Log Means for OTUslogmean_sim_fun
Simulating from a mixture of Gaussianmyrnormmix
Objective functionnllfun
Computes the optimal number of gaussian components for log mean countoptimal.comp
General-purpose log-likelihood function, vectorized sum(pars*x^i)polyfun
Fit a smooth power model for sample size estimationpower_fun_ss
Extract specified data from a list of datasetsread_data
general-purpose normal-mixture deviate generator: takes _matrices_ of probabilities, means, sdsrnormmix0
Estimate sample size required to achieve a target statistical powersample_size_ss_interp
Solve for the sample size required to achieve a target statistical powerss_solver
Sample Size estimation function using unirootuniroot_ss