| Title: | 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>. |
| Authors: | Andrea M. Kipingu [aut, cre] (ORCID: <https://orcid.org/0000-0002-9063-8651>, affiliation: Environmental Health & Ecological Sciences Department, Ifakara Health Institute, P.O. Box 78 373, Dar es Salaam, Tanzania), Mafalda Viana [aut] (ORCID: <https://orcid.org/0000-0001-5975-6505>, affiliation: School of Biodiversity, One Health and Veterinary Medicine, University of Glasgow, Graham Kerr Building, Glasgow, G12 8QQ, UK), Paul C.D. Johnson [aut] (ORCID: <https://orcid.org/0000-0001-6663-7520>, affiliation: School of Biodiversity, One Health & Veterinary Medicine, University of Glasgow, Wolfson Link Building, Glasgow, G12 8QQ, UK), Samson S. Kiware [aut] (ORCID: <https://orcid.org/0000-0001-7252-520X>, affiliation: Environmental Health & Ecological Sciences Department, Ifakara Health Institute, P.O. Box 78 373, Dar es Salaam, Tanzania) |
| Maintainer: | Andrea M. Kipingu <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.3 |
| Built: | 2026-05-15 09:10:41 UTC |
| Source: | https://github.com/akipingu/simpowa |
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>.
Maintainer: Andrea M. Kipingu [email protected] (ORCID) (Environmental Health & Ecological Sciences Department, Ifakara Health Institute, P.O. Box 78 373, Dar es Salaam, Tanzania)
Authors:
Mafalda Viana [email protected] (ORCID) (School of Biodiversity, One Health and Veterinary Medicine, University of Glasgow, Graham Kerr Building, Glasgow, G12 8QQ, UK)
Paul C.D. Johnson [email protected] (ORCID) (School of Biodiversity, One Health & Veterinary Medicine, University of Glasgow, Wolfson Link Building, Glasgow, G12 8QQ, UK)
Samson S. Kiware [email protected] (ORCID) (Environmental Health & Ecological Sciences Department, Ifakara Health Institute, P.O. Box 78 373, Dar es Salaam, Tanzania)
Useful links:
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.
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" )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" )
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 |
A data frame with columns:
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
Intervention status (e.g., 0 = control or no intervention 1 and 1 = there is intervention 1)
Intervention status (e.g., 0 = control or no intervention 2 and 1 = there is intervention 2)
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 sequence scaled between 0 and 1, it is calculate by the ratio of sampling points by their total number
This is just the same as "time" but as a factor
This is the interaction between an intvn1 and time, i.e., intvn1 x time
This is the interaction between an intvn2 and time, i.e., intvn2 x time
This is the interaction between an intvn1, intvn2 and time, i.e., intvn1 x intvn2 x time
Linear predictor with fixed effects only
Linear predictor with random chamber effects
Simulted mosquito counts through exponetial function from fixed effects only (no sampling)
Simulated mosquito counts through sampling distribution based on fixed effects only
Simulated mosquito counts through sampling distribution accounting for random effects
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" )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" )
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.
sim.mosq.longsfe.sinint( n.ch.per.trt, exp.length, sampl.freq = "weekly", lambda, intvn.effect, chamber.var, time.var, theta, use.random = "ALL" )sim.mosq.longsfe.sinint( n.ch.per.trt, exp.length, sampl.freq = "weekly", lambda, intvn.effect, chamber.var, time.var, theta, use.random = "ALL" )
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 |
A data frame with columns:
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
Intervention status (e.g., 0 = control or no intervention and 1 = there is intervention)
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 sequence scaled between 0 and 1, it is calculate by the ratio of sampling points by their total number
This is just the same as "time" but as a factor
This is the interaction between an intervention and time, i.e., intvn x time
Linear predictor with fixed effects only
Linear predictor with random chamber effects
Simulted mosquito counts through exponetial function from fixed effects only (no sampling)
Simulated mosquito counts through sampling distribution based on fixed effects only
Simulated mosquito counts through sampling distribution accounting for random effects
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" )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" )
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.
sim.mosq.shortsfe.comint( n.ch.per.trt, lambda, intvn1.effect, intvn2.effect, ixn.effect, chamber.var, use.random = "ALL" )sim.mosq.shortsfe.comint( n.ch.per.trt, lambda, intvn1.effect, intvn2.effect, ixn.effect, chamber.var, use.random = "ALL" )
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 |
A data frame with the following columns, depending on the use.random option:
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
Intervention status (e.g., 0 = control or no intervention 1 and 1 = there is intervention 1)
Intervention status (e.g., 0 = control or no intervention 2 and 1 = there is intervention 2)
Interventions interactions status (e.g., 0 = control or no intervention and 1 = there is interaction)
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)
Linear predictor with fixed effects only
Linear predictor with random chamber effects
Simulted mosquito counts through exponetial function from fixed effects only (no sampling)
Simulated mosquito counts through sampling distribution based on fixed effects only
Simulated mosquito counts through sampling distribution accounting for random effects
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" )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" )
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.
sim.mosq.shortsfe.sinint( n.ch.per.trt, lambda, intvn.effect, chamber.var, use.random = "ALL" )sim.mosq.shortsfe.sinint( n.ch.per.trt, lambda, intvn.effect, chamber.var, use.random = "ALL" )
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 |
A data frame with the following columns, depending on the use.random option:
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
Intervention status (e.g., 0 = control or no intervention and 1 = there is intervention)
Unique chamber identifier as a factor (e.g., 0-1, 0-2 for the control chambers and 1-1, 1-2 for intervention chambers)
Linear predictor with fixed effects only
Linear predictor with random chamber effects
Simulted mosquito counts through exponetial function from fixed effects only (no sampling)
Simulated mosquito counts through sampling distribution based on fixed effects only
Simulated mosquito counts through sampling distribution accounting for random effects
sim.mosq.shortsfe.sinint( n.ch.per.trt = 2, lambda = 50, intvn.effect = 0.8, chamber.var = 0.1807, use.random = "ALL" )sim.mosq.shortsfe.sinint( n.ch.per.trt = 2, lambda = 50, intvn.effect = 0.8, chamber.var = 0.1807, use.random = "ALL" )
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'.
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 )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 )
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 |
A 'ggplot' object showing mosquito counts over time by treatment group.
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 )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 )
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'.
sim.plot.longsfe.sinint( n.ch.per.trt, exp.length, sampl.freq = "weekly", lambda, intvn.effect, chamber.var, time.var, theta, use.random = TRUE )sim.plot.longsfe.sinint( n.ch.per.trt, exp.length, sampl.freq = "weekly", lambda, intvn.effect, chamber.var, time.var, theta, use.random = TRUE )
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 |
A 'ggplot' object showing mosquito counts over time by treatment group.
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 )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 )
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.
sim.plot.shortsfe.comint( n.ch.per.trt, lambda, intvn1.effect, intvn2.effect, ixn.effect, chamber.var, use.random = TRUE, jitter = TRUE )sim.plot.shortsfe.comint( n.ch.per.trt, lambda, intvn1.effect, intvn2.effect, ixn.effect, chamber.var, use.random = TRUE, jitter = TRUE )
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 |
A 'ggplot' object showing expected mosquito counts by treatment group.
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 )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 )
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.
sim.plot.shortsfe.sinint( n.ch.per.trt, lambda, intvn.effect, chamber.var, use.random = TRUE, jitter = TRUE )sim.plot.shortsfe.sinint( n.ch.per.trt, lambda, intvn.effect, chamber.var, use.random = TRUE, jitter = TRUE )
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 |
A 'ggplot' object showing expected mosquito counts by treatment group.
sim.plot.shortsfe.sinint( n.ch.per.trt = 2, lambda = 50, intvn.effect = 0.8, chamber.var = 0.1807, use.random = TRUE, jitter = TRUE )sim.plot.shortsfe.sinint( n.ch.per.trt = 2, lambda = 50, intvn.effect = 0.8, chamber.var = 0.1807, use.random = TRUE, jitter = TRUE )
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()'.
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 )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 )
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 |
A named numeric vector:
Estimated empirical power (rounded to two decimal places)
Lower bound of 95% confidence interval
Upper bound of 95% confidence interval
Parallel execution is supported via 'n.cores', but examples default to 'n.cores = 1' for reproducibility and package checks.
# 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 )# 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 )
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()'.
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 )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 )
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 |
A named numeric vector:
Estimated empirical power (rounded to two decimal places)
Lower bound of 95% confidence interval
Upper bound of 95% confidence interval
Parallel execution is supported via 'n.cores', but examples default to 'n.cores = 1' for reproducibility and package checks.
# 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 )# 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 )
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()'.
sim.power.shortsfe.comint( n.ch.per.trt, lambda, intvn1.effect, intvn2.effect, ixn.effect, chamber.var, nsim, n.cores = 1, use.random = TRUE )sim.power.shortsfe.comint( n.ch.per.trt, lambda, intvn1.effect, intvn2.effect, ixn.effect, chamber.var, nsim, n.cores = 1, use.random = TRUE )
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 |
A named numeric vector:
Estimated empirical power (rounded to two decimal places)
Lower bound of 95% confidence interval
Upper bound of 95% confidence interval
Parallel execution is supported via 'n.cores', but examples default to 'n.cores = 1' for reproducibility and package checks.
# 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 )# 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 )
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()'.
sim.power.shortsfe.sinint( n.ch.per.trt, lambda, intvn.effect, chamber.var, nsim, n.cores = 1, use.random = TRUE )sim.power.shortsfe.sinint( n.ch.per.trt, lambda, intvn.effect, chamber.var, nsim, n.cores = 1, use.random = TRUE )
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 |
A named numeric vector:
Estimated empirical power (rounded to two decimal places)
Lower bound of 95% confidence interval
Upper bound of 95% confidence interval
Parallel execution is supported via 'n.cores', but examples default to 'n.cores = 1' for reproducibility and package checks.
# 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 )# 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 )
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.
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 )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 )
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 |
A named numeric vector:
A p-value from likelihood ratio test comparing models with and without the interaction term
# 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 )# 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 )
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.
sim.pval.longsfe.sinint( n.ch.per.trt, exp.length, sampl.freq = "weekly", lambda, intvn.effect, chamber.var, time.var, theta, use.random = TRUE )sim.pval.longsfe.sinint( n.ch.per.trt, exp.length, sampl.freq = "weekly", lambda, intvn.effect, chamber.var, time.var, theta, use.random = TRUE )
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 |
A named numeric vector:
A p-value from likelihood ratio test comparing models with and without the interaction term
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 )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 )
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.
sim.pval.shortsfe.comint( n.ch.per.trt, lambda, intvn1.effect, intvn2.effect, ixn.effect, chamber.var, use.random = TRUE )sim.pval.shortsfe.comint( n.ch.per.trt, lambda, intvn1.effect, intvn2.effect, ixn.effect, chamber.var, use.random = TRUE )
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 |
A named numeric vector:
A p-value from likelihood ratio test comparing models with and without the interaction term
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 )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 )
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.
sim.pval.shortsfe.sinint( n.ch.per.trt, lambda, intvn.effect, chamber.var, use.random = TRUE )sim.pval.shortsfe.sinint( n.ch.per.trt, lambda, intvn.effect, chamber.var, use.random = TRUE )
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 |
A named numeric vector:
A p-value for the intervention effect from the GLMM
sim.pval.shortsfe.sinint( n.ch.per.trt = 2, lambda = 50, intvn.effect = 0.8, chamber.var = 0.1807, use.random = TRUE )sim.pval.shortsfe.sinint( n.ch.per.trt = 2, lambda = 50, intvn.effect = 0.8, chamber.var = 0.1807, use.random = TRUE )
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'.
sim.scen.longsfe.comint(n.ch.per.trt, exp.length, sampl.freq = "weekly")sim.scen.longsfe.comint(n.ch.per.trt, exp.length, sampl.freq = "weekly")
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. |
A data frame with columns:
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
Intervention status (e.g., 0 = control or no intervention 1 and 1 = there is intervention 1)
Intervention status (e.g., 0 = control or no intervention 2 and 1 = there is intervention 2)
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 sequence scaled between 0 and 1, it is calculate by the ratio of sampling points by their total number
This is just the same as "time" but as a factor
This is the interaction between an intvn1 and time, i.e., intvn1 x time
This is the interaction between an intvn2 and time, i.e., intvn2 x time
This is the interaction between an intvn1, intvn2 and time, i.e., intvn1 x intvn2 x time
sim.scen.longsfe.comint( n.ch.per.trt = 2, exp.length = 90, sampl.freq = "monthly" )sim.scen.longsfe.comint( n.ch.per.trt = 2, exp.length = 90, sampl.freq = "monthly" )
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'.
sim.scen.longsfe.sinint(n.ch.per.trt, exp.length, sampl.freq = "weekly")sim.scen.longsfe.sinint(n.ch.per.trt, exp.length, sampl.freq = "weekly")
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. |
A data frame with columns:
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
Intervention status (e.g., 0 = control or no intervention and 1 = there is intervention)
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 sequence scaled between 0 and 1, it is calculate by the ratio of sampling points by their total number
This is just the same as "time" but as a factor
This is the interaction between an intervention and time, i.e., intvn x time
sim.scen.longsfe.sinint( n.ch.per.trt = 2, exp.length = 90, sampl.freq = "monthly" )sim.scen.longsfe.sinint( n.ch.per.trt = 2, exp.length = 90, sampl.freq = "monthly" )
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'.
sim.scen.shortsfe.comint(n.ch.per.trt)sim.scen.shortsfe.comint(n.ch.per.trt)
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
A data frame with columns:
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
Intervention status (e.g., 0 = control or no intervention 1 and 1 = there is intervention 1)
Intervention status (e.g., 0 = control or no intervention 2 and 1 = there is intervention 2)
Interventions interactions status (e.g., 0 = control or no intervention and 1 = there is interaction)
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)
sim.scen.shortsfe.comint(n.ch.per.trt = 2)sim.scen.shortsfe.comint(n.ch.per.trt = 2)
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'.
sim.scen.shortsfe.sinint(n.ch.per.trt)sim.scen.shortsfe.sinint(n.ch.per.trt)
n.ch.per.trt |
An integer specifying the number of chambers allocated per treatment group. |
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.
A data frame with columns:
Replicate number within each treatment group (e.g., for a total of 2 chambers per treatment means 1, 2 replicates per treatment)
Intervention status (e.g., 0 = control or no intervention and 1 = there is intervention)
Unique chamber identifier as a factor (e.g., 0-1, 0-2 for the control chambers and 1-1, 1-2 for intervention chambers)
sim.scen.shortsfe.sinint(n.ch.per.trt = 2)sim.scen.shortsfe.sinint(n.ch.per.trt = 2)