| Type: | Package |
| Title: | Power Analysis and Sample Size Calculation for Semi-Field Vector Control Trials |
| Version: | 1.0.3 |
| Maintainer: | Andrea M. Kipingu <akipingu@ihi.or.tz> |
| Description: | Uses simulations from generalized linear mixed-effects models to incorporate random effects across multiple sources and levels of variation, and a dispersion parameter to account for overdispersion and capture unexplained variability. Covers design scenarios for both short-term and long-term trials evaluating the impact of single or combined vector control interventions. Methods build on Kipingu et al. (2025) <doi:10.1186/s12936-025-05454-y> and Johnson et al. (2015) <doi:10.1111/2041-210X.12306>. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Imports: | lme4, parallel, dplyr, ggplot2, stats |
| Suggests: | rmarkdown, testthat (≥ 3.0.0), waldo, devtools |
| Config/testthat/edition: | 3 |
| URL: | https://github.com/akipingu/simpowa |
| BugReports: | https://github.com/akipingu/simpowa/issues |
| NeedsCompilation: | no |
| Packaged: | 2026-03-24 19:31:07 UTC; dr.kipingu |
| Author: | Andrea M. Kipingu |
| Repository: | CRAN |
| Date/Publication: | 2026-03-29 16:00:02 UTC |
Power Analysis and Sample Size Calculation for Semi-Field Vector Control Trials
Description
Uses simulations from generalized linear mixed-effects models to incorporate random effects across multiple sources and levels of variation, and a dispersion parameter to account for overdispersion and capture unexplained variability. Covers design scenarios for both short-term and long-term trials evaluating the impact of single or combined vector control interventions. Methods build on Kipingu et al. (2025) <doi:10.1186/s12936-025-05454-y> and Johnson et al. (2015) <doi:10.1111/2041-210X.12306>.
Author(s)
Maintainer: Andrea M. Kipingu akipingu@ihi.or.tz (ORCID) (Environmental Health & Ecological Sciences Department, Ifakara Health Institute, P.O. Box 78 373, Dar es Salaam, Tanzania)
Authors:
Mafalda Viana mafalda.viana@glasgow.ac.uk (ORCID) (School of Biodiversity, One Health and Veterinary Medicine, University of Glasgow, Graham Kerr Building, Glasgow, G12 8QQ, UK)
Paul C.D. Johnson paul.johnson@glasgow.ac.uk (ORCID) (School of Biodiversity, One Health & Veterinary Medicine, University of Glasgow, Wolfson Link Building, Glasgow, G12 8QQ, UK)
Samson S. Kiware skiware@ihi.or.tz (ORCID) (Environmental Health & Ecological Sciences Department, Ifakara Health Institute, P.O. Box 78 373, Dar es Salaam, Tanzania)
See Also
Useful links:
Simulate Mosquito Count Data for Long-Term Semi-Field Experiment Testing Combined Interventions
Description
Generates simulated mosquito count data under a short-term semi-field experimental design with fixed effects for interventions 'intvn1' and 'intvn2', random effects for chambers and sampling time points variability, and a negative binomial distributed outcomes. Uses output from 'sim.scen.longsfe.comint()' to incorporate the table of experimental design scenarios.
Usage
sim.mosq.longsfe.comint(
n.ch.per.trt,
exp.length,
sampl.freq = "weekly",
lambda,
intvn1.effect,
intvn2.effect,
ixn.effect,
chamber.var,
time.var,
theta,
use.random = "ALL"
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn1.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 1 (e.g., ITN). |
intvn2.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 2 (PPFa). |
ixn.effect |
A numeric value representing the proportional reduction in mosquito count due to the interaction between interventions (e.g., ITN x PPFa). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
time.var |
A numeric value indicating the variance between sampling time points (random effect). |
theta |
A numeric value quantifying overdispersion parameter for the negative binomial distribution. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A data frame with columns:
- replicates
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
- intvn1
Intervention status (e.g., 0 = control or no intervention 1 and 1 = there is intervention 1)
- intvn2
Intervention status (e.g., 0 = control or no intervention 2 and 1 = there is intervention 2)
- chamber
Unique chamber identifier as a factor (e.g., 0-0-1, 0-0-2 for the control chambers and 0-1-1, 1-0-1, 1-1-1 for intervention chambers)
- time
Time sequence scaled between 0 and 1, it is calculate by the ratio of sampling points by their total number
- timef
This is just the same as "time" but as a factor
- ixn.intvn1.time
This is the interaction between an intvn1 and time, i.e., intvn1 x time
- ixn.intvn2.time
This is the interaction between an intvn2 and time, i.e., intvn2 x time
- ixn.intvn1.intvn2.time
This is the interaction between an intvn1, intvn2 and time, i.e., intvn1 x intvn2 x time
- lin.pred.fixed
Linear predictor with fixed effects only
- lin.pred.random
Linear predictor with random chamber effects
- mosquito.count.fixed.exp
Simulted mosquito counts through exponetial function from fixed effects only (no sampling)
- mosquito.count.fixed
Simulated mosquito counts through sampling distribution based on fixed effects only
- mosquito.count.random
Simulated mosquito counts through sampling distribution accounting for random effects
Examples
sim.mosq.longsfe.comint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly",
lambda = 10,
intvn1.effect = 0.7,
intvn2.effect = 0.8,
ixn.effect = 0.8,
chamber.var = 0.1807,
time.var = 0.2266,
theta = 10,
use.random = "ALL"
)
Simulate Mosquito Count Data for Long-Term Semi-Field Experiment Testing Single Intervention
Description
Generates simulated mosquito count data under a short-term semi-field experimental design with fixed effects for intervention ('intvn'), random effects for chambers and sampling time points variability, and a negative binomial distributed outcomes. Uses output from 'sim.scen.longsfe.sinint()' to incorporate the table of experimental design scenarios.
Usage
sim.mosq.longsfe.sinint(
n.ch.per.trt,
exp.length,
sampl.freq = "weekly",
lambda,
intvn.effect,
chamber.var,
time.var,
theta,
use.random = "ALL"
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention (e.g., ITN). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
time.var |
A numeric value indicating the variance between sampling time points (random effect). |
theta |
A numeric value quantifying overdispersion parameter for the negative binomial distribution. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A data frame with columns:
- replicates
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
- intvn
Intervention status (e.g., 0 = control or no intervention and 1 = there is intervention)
- chamber
Unique chamber identifier as a factor (e.g., 0-1, 0-2 for the control chambers and 1-1, 1-2 for intervention chambers)
- time
Time sequence scaled between 0 and 1, it is calculate by the ratio of sampling points by their total number
- timef
This is just the same as "time" but as a factor
- intvn.time
This is the interaction between an intervention and time, i.e., intvn x time
- lin.pred.fixed
Linear predictor with fixed effects only
- lin.pred.random
Linear predictor with random chamber effects
- mosquito.count.fixed.exp
Simulted mosquito counts through exponetial function from fixed effects only (no sampling)
- mosquito.count.fixed
Simulated mosquito counts through sampling distribution based on fixed effects only
- mosquito.count.random
Simulated mosquito counts through sampling distribution accounting for random effects
Examples
sim.mosq.longsfe.sinint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly",
lambda = 10,
intvn.effect = 0.8,
chamber.var = 0.1807,
time.var = 0.2266,
theta = 10,
use.random = "ALL"
)
Simulate Mosquito Count Data for Short-Term Semi-Field Experiment Testing Combined Interventions
Description
Generates simulated mosquito count data under a short-term semi-field experimental design with fixed effects for interventions, 'intvn1' and 'intvn2', random effects for chamber variability, and Poisson-distributed outcomes. Uses output from 'sim.scen.shortsfe.comint()' to incorporate the table of experimental design scenarios.
Usage
sim.mosq.shortsfe.comint(
n.ch.per.trt,
lambda,
intvn1.effect,
intvn2.effect,
ixn.effect,
chamber.var,
use.random = "ALL"
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn1.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 1 (e.g., ITN). |
intvn2.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 2 (e.g., PPFa). |
ixn.effect |
A numeric value representing the proportional reduction in mosquito count due to the interaction (e.g., ITN x PPFa). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A data frame with the following columns, depending on the use.random option:
- replicates
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
- intvn1
Intervention status (e.g., 0 = control or no intervention 1 and 1 = there is intervention 1)
- intvn2
Intervention status (e.g., 0 = control or no intervention 2 and 1 = there is intervention 2)
- ixn
Interventions interactions status (e.g., 0 = control or no intervention and 1 = there is interaction)
- chamber
Unique chamber identifier as a factor (e.g., 0-0-1, 0-0-2 for the control chambers and 0-1-1, 1-0-1, 1-1-1 for intervention chambers)
- lin.pred.fixed
Linear predictor with fixed effects only
- lin.pred.random
Linear predictor with random chamber effects
- mosquito.count.fixed.exp
Simulted mosquito counts through exponetial function from fixed effects only (no sampling)
- mosquito.count.fixed
Simulated mosquito counts through sampling distribution based on fixed effects only
- mosquito.count.random
Simulated mosquito counts through sampling distribution accounting for random effects
Examples
sim.mosq.shortsfe.comint(
n.ch.per.trt = 2,
lambda = 50,
intvn1.effect = 0.7,
intvn2.effect = 0.8,
ixn.effect = 0.5,
chamber.var = 0.1807,
use.random = "ALL"
)
Simulate Mosquito Count Data for Short-Term Semi-Field Experiment Testing Single Intervention
Description
Generates simulated mosquito count data under a short-term semi-field experimental design with fixed effects for intervention ('intvn'), random effects for chamber variability, and Poisson-distributed outcomes. Uses output from 'sim.scen.shortsfe.sinint()' to incorporate the table of experimental design scenarios.
Usage
sim.mosq.shortsfe.sinint(
n.ch.per.trt,
lambda,
intvn.effect,
chamber.var,
use.random = "ALL"
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention (e.g., ITN). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A data frame with the following columns, depending on the use.random option:
- replicates
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
- intvn
Intervention status (e.g., 0 = control or no intervention and 1 = there is intervention)
- chamber
Unique chamber identifier as a factor (e.g., 0-1, 0-2 for the control chambers and 1-1, 1-2 for intervention chambers)
- lin.pred.fixed
Linear predictor with fixed effects only
- lin.pred.random
Linear predictor with random chamber effects
- mosquito.count.fixed.exp
Simulted mosquito counts through exponetial function from fixed effects only (no sampling)
- mosquito.count.fixed
Simulated mosquito counts through sampling distribution based on fixed effects only
- mosquito.count.random
Simulated mosquito counts through sampling distribution accounting for random effects
Examples
sim.mosq.shortsfe.sinint(
n.ch.per.trt = 2,
lambda = 50,
intvn.effect = 0.8,
chamber.var = 0.1807,
use.random = "ALL"
)
Plot Mosquito Counts for Long-Term Semi-Field Experiment Testing Combined Interventions
Description
Generates a time series plot of mosquito counts based on either fixed effects only, random effects, or fixed effects (no sampling distribution), using data simulated by 'sim.mosq.longsfe.comint'.
Usage
sim.plot.longsfe.comint(
n.ch.per.trt,
exp.length,
sampl.freq = "weekly",
lambda,
intvn1.effect,
intvn2.effect,
ixn.effect,
chamber.var,
time.var,
theta,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn1.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 1 (e.g., ITN). |
intvn2.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 2 (PPFa). |
ixn.effect |
A numeric value representing the proportional reduction in mosquito count due to the interaction between interventions (e.g., ITN x PPFa). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
time.var |
A numeric value indicating the variance between sampling time points (random effect). |
theta |
A numeric value quantifying overdispersion parameter for the negative binomial distribution. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A 'ggplot' object showing mosquito counts over time by treatment group.
Examples
sim.plot.longsfe.comint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly",
lambda = 10,
intvn1.effect = 0.7,
intvn2.effect = 0.8,
ixn.effect = 0.8,
chamber.var = 0.1807,
time.var = 0.2266,
theta = 10,
use.random = TRUE
)
Plot Mosquito Counts for Long-Term Semi-Field Experiment Testing Single Intervention
Description
Generates a time series plot of mosquito counts based on use.random with either fixed effects only, random effects, or fixed effects (no sampling distribution), using data simulated by 'sim.mosq.longsfe.sinint'.
Usage
sim.plot.longsfe.sinint(
n.ch.per.trt,
exp.length,
sampl.freq = "weekly",
lambda,
intvn.effect,
chamber.var,
time.var,
theta,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention (e.g., ITN). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
time.var |
A numeric value indicating the variance between sampling time points (random effect). |
theta |
A numeric value quantifying overdispersion parameter for the negative binomial distribution. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A 'ggplot' object showing mosquito counts over time by treatment group.
Examples
sim.plot.longsfe.sinint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly",
lambda = 10,
intvn.effect = 0.8,
chamber.var = 0.1807,
time.var = 0.2266,
theta = 10,
use.random = TRUE
)
Plot Mosquito Counts for Short-Term Semi-Field Experiment Testing Combined Interventions
Description
Generates a boxplot of simulated mosquito counts grouped by intervention combinations. Uses output from 'sim.mosq.shortsfe.comint()' and overlays jittered points to show chamber-level variation.
Usage
sim.plot.shortsfe.comint(
n.ch.per.trt,
lambda,
intvn1.effect,
intvn2.effect,
ixn.effect,
chamber.var,
use.random = TRUE,
jitter = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn1.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 1 (e.g., ITN). |
intvn2.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 2 (e.g., PPFa). |
ixn.effect |
A numeric value representing the proportional reduction in mosquito count due to the interaction (e.g., ITN x PPFa). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
jitter |
A logical value indicating whether to overlay individual chamber-level points
If |
Value
A 'ggplot' object showing expected mosquito counts by treatment group.
Examples
sim.plot.shortsfe.comint(
n.ch.per.trt = 2,
lambda = 50,
intvn1.effect = 0.7,
intvn2.effect = 0.8,
ixn.effect = 0.5,
chamber.var = 0.1807,
use.random = TRUE,
jitter = TRUE
)
Plot Mosquito Counts from Short-Term Semi-Field Experiment Testing Single Intervention
Description
Generates a boxplot of simulated mosquito counts grouped by intervention status (Control vs Intervention). Uses output from 'sim.mosq.shortsfe.sinint()' and can overlay jittered points to show chamber-level variation.
Usage
sim.plot.shortsfe.sinint(
n.ch.per.trt,
lambda,
intvn.effect,
chamber.var,
use.random = TRUE,
jitter = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention (e.g., ITN). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
use.random |
A logical value indicating whether to plot mosquito counts simulated using a sampling distribution (with random or fixed effects) or exponential function (fixed effect)
If |
jitter |
A logical value indicating whether to overlay individual chamber-level points
If |
Value
A 'ggplot' object showing expected mosquito counts by treatment group.
Examples
sim.plot.shortsfe.sinint(
n.ch.per.trt = 2,
lambda = 50,
intvn.effect = 0.8,
chamber.var = 0.1807,
use.random = TRUE,
jitter = TRUE
)
Estimate Empirical Power for Long-Term Semi-Field Experiment Testing Combined Interventions
Description
Runs repeated simulations and negative binomial GLMM fits to estimate empirical power as the proportion of simulations with p-values below 0.05. These p-values are generated using the function called 'sim.pval.longsfe.comint()'.
Usage
sim.power.longsfe.comint(
n.ch.per.trt,
exp.length,
sampl.freq,
lambda,
intvn1.effect,
intvn2.effect,
ixn.effect,
chamber.var,
time.var,
theta,
nsim = 100,
n.cores = 1,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn1.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 1 (e.g., ITN). |
intvn2.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 2 (PPFa). |
ixn.effect |
A numeric value representing the proportional reduction in mosquito count due to the interaction between interventions (e.g., ITN x PPFa). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
time.var |
A numeric value indicating the variance between sampling time points (random effect). |
theta |
A numeric value quantifying overdispersion parameter for the negative binomial distribution. |
nsim |
An integer indicating the total number of simulations. |
n.cores |
An integer the number of cores to use for parallel processing. |
use.random |
A logical value indicating whether to plot mosquito counts simulated using a sampling distribution (with random or fixed effects).
If |
Value
A named numeric vector:
- power
Estimated empirical power (rounded to two decimal places)
- ci.lower
Lower bound of 95% confidence interval
- ci.upper
Upper bound of 95% confidence interval
Note
Parallel execution is supported via 'n.cores', but examples default to 'n.cores = 1' for reproducibility and package checks.
Examples
# For a realistic SFE design, nsim should be at least 1000.
sim.power.longsfe.comint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly",
lambda = 10,
intvn1.effect = 0.7,
intvn2.effect = 0.8,
ixn.effect = 0.8,
chamber.var = 0.1807,
time.var = 0.2266,
theta = 10,
nsim = 2,
n.cores = 1,
use.random = TRUE
)
Estimate Empirical Power for Long-Term Semi-Field Experiment Testing Single Intervention
Description
Runs repeated simulations and negative binomial GLMM fits to estimate empirical power as the proportion of simulations with p-values below 0.05. These p-values are generated using the function called 'sim.pval.longsfe.sinint()'.
Usage
sim.power.longsfe.sinint(
n.ch.per.trt,
exp.length,
sampl.freq,
lambda,
intvn.effect,
chamber.var,
time.var,
theta,
nsim = 100,
n.cores = 1,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention (e.g., ITN). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
time.var |
A numeric value indicating the variance between sampling time points (random effect). |
theta |
A numeric value quantifying overdispersion parameter for the negative binomial distribution. |
nsim |
An integer indicating the total number of simulations. |
n.cores |
An integer the number of cores to use for parallel processing. |
use.random |
A logical value indicating whether to plot mosquito counts simulated using a sampling distribution (with random or fixed effects).
If |
Value
A named numeric vector:
- power
Estimated empirical power (rounded to two decimal places)
- ci.lower
Lower bound of 95% confidence interval
- ci.upper
Upper bound of 95% confidence interval
Note
Parallel execution is supported via 'n.cores', but examples default to 'n.cores = 1' for reproducibility and package checks.
Examples
# For a realistic SFE design, nsim should be at least 1000.
sim.power.longsfe.sinint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly",
lambda = 10,
intvn.effect = 0.8,
chamber.var = 0.1807,
time.var = 0.2266,
theta = 10,
nsim = 2,
n.cores = 1,
use.random = TRUE
)
Estimate Empirical Power for Short-Term Semi-Field Experiment Testing Combined Intervention
Description
Runs repeated simulations and Poisson GLMM fits to estimate empirical power as the proportion of simulations with p-values below 0.05. These p-values are generated using the function called 'sim.pval.shortsfe.comint()'.
Usage
sim.power.shortsfe.comint(
n.ch.per.trt,
lambda,
intvn1.effect,
intvn2.effect,
ixn.effect,
chamber.var,
nsim,
n.cores = 1,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn1.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 1 (e.g., ITN). |
intvn2.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 2 (e.g., PPFa). |
ixn.effect |
A numeric value representing the proportional reduction in mosquito count due to the interaction (e.g., ITN x PPFa). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
nsim |
An integer indicating the total number of simulations. |
n.cores |
An integer the number of cores to use for parallel processing. |
use.random |
A logical value indicating whether to plot mosquito counts simulated using a sampling distribution (with random or fixed effects).
If |
Value
A named numeric vector:
- power
Estimated empirical power (rounded to two decimal places)
- ci.lower
Lower bound of 95% confidence interval
- ci.upper
Upper bound of 95% confidence interval
Note
Parallel execution is supported via 'n.cores', but examples default to 'n.cores = 1' for reproducibility and package checks.
Examples
# For a realistic SFE design, nsim should be at least 1000.
sim.power.shortsfe.comint(
n.ch.per.trt = 2,
lambda = 50,
intvn1.effect = 0.7,
intvn2.effect = 0.8,
ixn.effect = 0.5,
chamber.var = 0.1807,
nsim = 2,
n.cores = 1,
use.random = TRUE
)
Estimate Empirical Power for Short-Term Semi-Field Experiment Testing Single Intervention
Description
Runs repeated simulations and Poisson GLMM fits to estimate empirical power as the proportion of simulations with p-values below 0.05. These p-values are generated using the function called 'sim.pval.shortsfe.sinint()'.
Usage
sim.power.shortsfe.sinint(
n.ch.per.trt,
lambda,
intvn.effect,
chamber.var,
nsim,
n.cores = 1,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention (e.g., ITN). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
nsim |
An integer indicating the total number of simulations. |
n.cores |
An integer the number of cores to use for parallel processing. |
use.random |
A logical value indicating whether to plot mosquito counts simulated using a sampling distribution (with random or fixed effects).
If |
Value
A named numeric vector:
- power
Estimated empirical power (rounded to two decimal places)
- ci.lower
Lower bound of 95% confidence interval
- ci.upper
Upper bound of 95% confidence interval
Note
Parallel execution is supported via 'n.cores', but examples default to 'n.cores = 1' for reproducibility and package checks.
Examples
# For a realistic SFE design, nsim should be at least 1000.
sim.power.shortsfe.sinint(
n.ch.per.trt = 2,
lambda = 50,
intvn.effect = 0.8,
chamber.var = 0.1807,
nsim = 2,
n.cores = 1,
use.random = TRUE
)
Extract p-value from Simulated GLMM for Long-Term Semi-Field Experiment Testing Combined Interventions
Description
Returns the p-value by fitting a negative binomial GLMM to simulated mosquito count data. Uses simulated mosquito counts data from 'sim.mosq.longsfe.comint()' and fits a negative binomial GLMM to extract the p-value associated with the intvn effect.
Usage
sim.pval.longsfe.comint(
n.ch.per.trt,
exp.length,
sampl.freq = "weekly",
lambda,
intvn1.effect,
intvn2.effect,
ixn.effect,
chamber.var,
time.var,
theta,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn1.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 1 (e.g., ITN). |
intvn2.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 2 (PPFa). |
ixn.effect |
A numeric value representing the proportional reduction in mosquito count due to the interaction between interventions (e.g., ITN x PPFa). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
time.var |
A numeric value indicating the variance between sampling time points (random effect). |
theta |
A numeric value quantifying overdispersion parameter for the negative binomial distribution. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A named numeric vector:
- pvalue
A p-value from likelihood ratio test comparing models with and without the interaction term
Examples
# For a realistic SFE design, nsim should be at least 1000
sim.pval.longsfe.comint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly",
lambda = 10,
intvn1.effect = 0.7,
intvn2.effect = 0.8,
ixn.effect = 0.8,
chamber.var = 0.1807,
time.var = 0.2266,
theta = 10,
use.random = TRUE
)
Extract p-value from Simulated GLMM for Long-Term Semi-Field Experiment Testing Single Intervention
Description
Returns the p-value by fitting a negative binomial GLMM to simulated mosquito count data. Uses simulated mosquito counts data from 'sim.mosq.longsfe.sinint()' and fits a negative binomial GLMM to extract the p-value associated with the intvn effect.
Usage
sim.pval.longsfe.sinint(
n.ch.per.trt,
exp.length,
sampl.freq = "weekly",
lambda,
intvn.effect,
chamber.var,
time.var,
theta,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention (e.g., ITN). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
time.var |
A numeric value indicating the variance between sampling time points (random effect). |
theta |
A numeric value quantifying overdispersion parameter for the negative binomial distribution. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A named numeric vector:
- pvalue
A p-value from likelihood ratio test comparing models with and without the interaction term
Examples
sim.pval.longsfe.sinint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly",
lambda = 10,
intvn.effect = 0.8,
chamber.var = 0.1807,
time.var = 0.2266,
theta = 10,
use.random = TRUE
)
Extract p-value from Simulated GLMM for Short-Term Semi-Field Experiment Testing Combined Interventions
Description
Returns the p-value by fitting a Poisson GLMM to simulated mosquito count data. Uses simulated mosquito counts data from 'sim.mosq.shortsfe.comint()' and fits a Poisson GLMM to extract the p-value associated with the intvn effect.
Usage
sim.pval.shortsfe.comint(
n.ch.per.trt,
lambda,
intvn1.effect,
intvn2.effect,
ixn.effect,
chamber.var,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn1.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 1 (e.g., ITN). |
intvn2.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention 2 (e.g., PPFa). |
ixn.effect |
A numeric value representing the proportional reduction in mosquito count due to the interaction (e.g., ITN x PPFa). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
use.random |
A logical value indicating whether to return mosquito counts simulated through a sampling distribution (with random or fixed chamber effects) or all.
If |
Value
A named numeric vector:
- pvalue
A p-value from likelihood ratio test comparing models with and without the interaction term
Examples
sim.pval.shortsfe.comint(
n.ch.per.trt = 2,
lambda = 50,
intvn1.effect = 0.7,
intvn2.effect = 0.8,
ixn.effect = 0.5,
chamber.var = 0.1807,
use.random = TRUE
)
Extract p-values from Simulated GLMM for Short-Term Semi-Field Experiment Testing Single Intervention
Description
Returns the p-value by fitting a Poisson GLMM to simulated mosquito count data. Uses simulated mosquito counts data from 'sim.mosq.shortsfe.sinint()' and fits a Poisson GLMM to extract the p-value associated with the intvn effect.
Usage
sim.pval.shortsfe.sinint(
n.ch.per.trt,
lambda,
intvn.effect,
chamber.var,
use.random = TRUE
)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
lambda |
A numeric value indicating the expected mean mosquito count in control chambers. |
intvn.effect |
A numeric value representing the proportional reduction in mosquito count due to the intervention (e.g., ITN). |
chamber.var |
A numeric value specifying the variance of random chamber-level effects. |
use.random |
A logical value indicating whether to plot mosquito counts simulated using a sampling distribution (with random or fixed effects) or exponential function (fixed effect)
If |
Value
A named numeric vector:
- pvalue
A p-value for the intervention effect from the GLMM
Examples
sim.pval.shortsfe.sinint(
n.ch.per.trt = 2,
lambda = 50,
intvn.effect = 0.8,
chamber.var = 0.1807,
use.random = TRUE
)
Simulate Design Scenarios for Long-Term Semi-Filed Experiment Testing Combined Interventions
Description
Constructs a data frame representing the factorial design of semi-field experiments testing combined interventions. Each chamber is uniquely identified and assigned treatments combinations, including interaction terms. The intervention here are shortly named as 'intvn1' and 'intvn2'.
Usage
sim.scen.longsfe.comint(n.ch.per.trt, exp.length, sampl.freq = "weekly")
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
Value
A data frame with columns:
- replicates
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
- intvn1
Intervention status (e.g., 0 = control or no intervention 1 and 1 = there is intervention 1)
- intvn2
Intervention status (e.g., 0 = control or no intervention 2 and 1 = there is intervention 2)
- chamber
Unique chamber identifier as a factor (e.g., 0-0-1, 0-0-2 for the control chambers and 0-1-1, 1-0-1, 1-1-1 for intervention chambers)
- time
Time sequence scaled between 0 and 1, it is calculate by the ratio of sampling points by their total number
- timef
This is just the same as "time" but as a factor
- ixn.intvn1.time
This is the interaction between an intvn1 and time, i.e., intvn1 x time
- ixn.intvn2.time
This is the interaction between an intvn2 and time, i.e., intvn2 x time
- ixn.intvn1.intvn2.time
This is the interaction between an intvn1, intvn2 and time, i.e., intvn1 x intvn2 x time
Examples
sim.scen.longsfe.comint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly"
)
Simulate Design Scenarios for Long-Term Semi-Field Experiment Testing Single Intervention
Description
Constructs a design scenario table representing a short-term semi-field experiment with two treatment levels (or intervention status), i.e., control (no intervention) and intervention, and a specified number of chambers or compartment per treatment. Each chamber is uniquely identified by a treatment level and a replicate combination. An intervention here is shortly named as 'intvn'.
Usage
sim.scen.longsfe.sinint(n.ch.per.trt, exp.length, sampl.freq = "weekly")
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
exp.length |
An integer indicating total duration of the experiment in days, e.g., 90 days. |
sampl.freq |
A character for a sampling frequency label. Example, for 90 days experiment; '"daily"' means 90 sampling points, '"weekly"' means 12 sampling points, '"biweekly"' means 6 sampling points, or '"monthly"' means 3 sampling points. |
Value
A data frame with columns:
- replicates
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
- intvn
Intervention status (e.g., 0 = control or no intervention and 1 = there is intervention)
- chamber
Unique chamber identifier as a factor (e.g., 0-1, 0-2 for the control chambers and 1-1, 1-2 for intervention chambers)
- time
Time sequence scaled between 0 and 1, it is calculate by the ratio of sampling points by their total number
- timef
This is just the same as "time" but as a factor
- intvn.time
This is the interaction between an intervention and time, i.e., intvn x time
Examples
sim.scen.longsfe.sinint(
n.ch.per.trt = 2,
exp.length = 90,
sampl.freq = "monthly"
)
Simulate Design Scenarios for Short-Term Semi-Field Experiment Testing Combined Interventions
Description
Constructs a data frame representing the factorial design of semi-field experiments testing combined interventions. Each chamber is uniquely identified and assigned treatments combinations, including interaction terms. The intervention here are shortly named as 'intvn1' and 'intvn2'.
Usage
sim.scen.shortsfe.comint(n.ch.per.trt)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
Value
A data frame with columns:
- replicates
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
- intvn1
Intervention status (e.g., 0 = control or no intervention 1 and 1 = there is intervention 1)
- intvn2
Intervention status (e.g., 0 = control or no intervention 2 and 1 = there is intervention 2)
- ixn
Interventions interactions status (e.g., 0 = control or no intervention and 1 = there is interaction)
- chamber
Unique chamber identifier as a factor (e.g., 0-0-1, 0-0-2 for the control chambers and 0-1-1, 1-0-1, 1-1-1 for intervention chambers)
Examples
sim.scen.shortsfe.comint(n.ch.per.trt = 2)
Simulate Design Scenarios for Short-Term Semi-Field Experiment Testing Single Intervention
Description
Constructs a design scenario table representing a short-term semi-field experiment with two treatment levels (or intervention status), i.e., control (no intervention) and intervention, and a specified number of chambers or compartment per treatment. Each chamber is uniquely identified by a treatment level and a replicate combination. An intervention here is shortly named as 'intvn'.
Usage
sim.scen.shortsfe.sinint(n.ch.per.trt)
Arguments
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
Details
This function considers a single design parameter, which is the total number of chambers or compartments per treatment ('n.ch.per.trt'), e.g., 4. The 'n.ch.per.trt' indicates how many chambers known as 'replicates' are present per treatment.
Value
A data frame with columns:
- replicates
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
- intvn
Intervention status (e.g., 0 = control or no intervention and 1 = there is intervention)
- chamber
Unique chamber identifier as a factor (e.g., 0-1, 0-2 for the control chambers and 1-1, 1-2 for intervention chambers)
Examples
sim.scen.shortsfe.sinint(n.ch.per.trt = 2)