| Title: | Compatible Point Estimates, Confidence Intervals, and P-Values for Two Trials |
|---|---|
| Description: | Implements combined p-value functions for two trials along with compatible combined point and interval estimates as described in Pawel, Roos, and Held (2025) <doi:10.48550/arXiv.2503.10246>. |
| Authors: | Samuel Pawel [aut, cre] (ORCID: <https://orcid.org/0000-0003-2779-320X>) |
| Maintainer: | Samuel Pawel <[email protected]> |
| License: | GPL-3 |
| Version: | 0.6 |
| Built: | 2026-06-02 10:02:02 UTC |
| Source: | https://github.com/cran/twotrials |
This function computes parameter estimates from the combined estimation function based on the two-trials rule
mu2TR(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)mu2TR(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)
a |
P-value function quantile corresponding to the parameter estimate.
Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
... |
Additional arguments (for consistency with other estimation functions) |
The parameter estimate based on the two-trials rule
Samuel Pawel
## 95% CI and median estimate for logRR in RESPIRE trials mu2TR(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## 95% CI and median estimate for logRR in RESPIRE trials mu2TR(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
This function computes parameter estimates from the combined estimation function based on Edgington's method
muEdgington(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)muEdgington(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)
a |
P-value function quantile corresponding to the parameter estimate.
Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
... |
Additional arguments for |
The parameter estimate based on Edgington's method
Samuel Pawel
## 95% CI and median estimate for logRR in RESPIRE trials muEdgington(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## 95% CI and median estimate for logRR in RESPIRE trials muEdgington(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
This function computes parameter estimates from the combined estimation function based on Fisher's method
muFisher(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)muFisher(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)
a |
P-value function quantile corresponding to the parameter estimate.
Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
... |
Additional arguments for |
The parameter estimate based on Fisher's method
Samuel Pawel
## 95% CI and median estimate for logRR in RESPIRE trials muFisher(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## 95% CI and median estimate for logRR in RESPIRE trials muFisher(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
This function computes parameter estimates from the combined estimation function based on fixed-effect meta-analysis
muMA(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)muMA(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)
a |
P-value function quantile corresponding to the parameter estimate.
Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
... |
Additional arguments (for consistency with other estimation functions) |
The parameter estimate based on fixed-effect meta-analysis
Samuel Pawel
## 95% CI and median estimate for logRR in RESPIRE trials muMA(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## 95% CI and median estimate for logRR in RESPIRE trials muMA(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
This function computes parameter estimates from the combined estimation function based on Pearson's method
muPearson(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)muPearson(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)
a |
P-value function quantile corresponding to the parameter estimate.
Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
... |
Additional arguments for |
The parameter estimate based on Pearson's method
Samuel Pawel
## 95% CI and median estimate for logRR in RESPIRE trials muPearson(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## 95% CI and median estimate for logRR in RESPIRE trials muPearson(a = c(0.975, 0.5, 0.025), t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
This function computes parameter estimates from the combined estimation function based on Tippett's method
muTippett(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)muTippett(a = 0.5, t1, t2, se1, se2, alternative = "greater", ...)
a |
P-value function quantile corresponding to the parameter estimate.
Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
... |
Additional arguments (for consistency with other estimation functions) |
The parameter estimate based on Tippett's method
Samuel Pawel
## 95% CI and median estimate for logRR in RESPIRE trials muTippett(a = c(0.975, 0.5, 0.025), t1 = -0.491, t2 = -0.185, se1 = 0.179, se2 = 0.174, alternative = "less")## 95% CI and median estimate for logRR in RESPIRE trials muTippett(a = c(0.975, 0.5, 0.025), t1 = -0.491, t2 = -0.185, se1 = 0.179, se2 = 0.174, alternative = "less")
This function computes the combined p-value based on two parameter estimates using the two-trials rule (also known as the maximum method)
p2TR(mu = 0, t1, t2, se1, se2, alternative = "greater")p2TR(mu = 0, t1, t2, se1, se2, alternative = "greater")
mu |
Null value. Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
The combined p-value based on the two-trials rule
Samuel Pawel
## p-value for H0: logRR = 0 in RESPIRE trials p2TR(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## p-value for H0: logRR = 0 in RESPIRE trials p2TR(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
This function computes the combined p-value based on two parameter estimates using Edgington's method (also known as the sum method)
pEdgington(mu = 0, t1, t2, se1, se2, alternative = "greater")pEdgington(mu = 0, t1, t2, se1, se2, alternative = "greater")
mu |
Null value. Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
The combined p-value based on Edgington's method
Samuel Pawel
## p-value for H0: logRR = 0 in RESPIRE trials pEdgington(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## p-value for H0: logRR = 0 in RESPIRE trials pEdgington(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
This function computes the combined p-value based on two parameter estimates using the Fisher's method (also known as the product method)
pFisher(mu = 0, t1, t2, se1, se2, alternative = "greater")pFisher(mu = 0, t1, t2, se1, se2, alternative = "greater")
mu |
Null value. Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
The combined p-value based on Fisher's method
Samuel Pawel
## p-value for H0: logRR = 0 in RESPIRE trials pFisher(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## p-value for H0: logRR = 0 in RESPIRE trials pFisher(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
"twotrials"
Plot method for class "twotrials"
## S3 method for class 'twotrials' plot( x, xlim = c(min(x$isummaries$lower), max(x$isummaries$upper)), two.sided = FALSE, plot = TRUE, ... )## S3 method for class 'twotrials' plot( x, xlim = c(min(x$isummaries$lower), max(x$isummaries$upper)), two.sided = FALSE, plot = TRUE, ... )
x |
Object of class |
xlim |
x-axis limits. Defaults to the confidence interval range of trial 1 and trial 2 |
two.sided |
Logical indicating whether the p-value functions should be
converted to a two-sided p-value function via the centrality function
2min(p, 1 - p). Defaults to |
plot |
Logical indicating whether p-value functions should be plotted.
Defaults to |
... |
Other arguments (for consistency with the generic) |
Plots combined p-value functions and invisibly returns a data frame containing the data underlying the plot
Samuel Pawel
## logRR estimates from RESPIRE trials res <- twotrials(null = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less", level = 0.95) plot(res) # one-sided p-value functions plot(res, two.sided = TRUE) # two-sided p-value functions## logRR estimates from RESPIRE trials res <- twotrials(null = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less", level = 0.95) plot(res) # one-sided p-value functions plot(res, two.sided = TRUE) # two-sided p-value functions
This function computes the combined p-value based on two parameter estimates using fixed-effect meta-analysis (equivalent to Stouffer's p-value combination method with suitable weights)
pMA(mu = 0, t1, t2, se1, se2, alternative = "greater")pMA(mu = 0, t1, t2, se1, se2, alternative = "greater")
mu |
Null value. Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
The combined p-value based on fixed-effect meta-analysis
Samuel Pawel
## p-value for H0: logRR = 0 in RESPIRE trials pMA(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## p-value for H0: logRR = 0 in RESPIRE trials pMA(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
This function computes the combined p-value based on two parameter estimates using Pearson's method
pPearson(mu = 0, t1, t2, se1, se2, alternative = "greater")pPearson(mu = 0, t1, t2, se1, se2, alternative = "greater")
mu |
Null value. Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
The combined p-value based on Pearson's method
Samuel Pawel
## p-value for H0: logRR = 0 in RESPIRE trials pPearson(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")## p-value for H0: logRR = 0 in RESPIRE trials pPearson(mu = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less")
"twotrials"
Print method for class "twotrials"
## S3 method for class 'twotrials' print(x, digits = 3, ...)## S3 method for class 'twotrials' print(x, digits = 3, ...)
x |
Object of class |
digits |
Number of digits for formatting of numbers |
... |
Other arguments (for consistency with the generic) |
Prints text summary in the console and invisibly returns the
"twotrials" object
Samuel Pawel
## logRR estimates from RESPIRE trials twotrials(null = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less", level = 0.95)## logRR estimates from RESPIRE trials twotrials(null = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less", level = 0.95)
This function computes the combined p-value based on two parameter estimates using Tippett's method (also known as the minimum method)
pTippett(mu = 0, t1, t2, se1, se2, alternative = "greater")pTippett(mu = 0, t1, t2, se1, se2, alternative = "greater")
mu |
Null value. Defaults to |
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
The combined p-value based on Tippett's method
Samuel Pawel
## p-value for H0: logRR = 0 in RESPIRE trials pTippett(mu = 0, t1 = -0.491, t2 = -0.185, se1 = 0.179, se2 = 0.174, alternative = "less")## p-value for H0: logRR = 0 in RESPIRE trials pTippett(mu = 0, t1 = -0.491, t2 = -0.185, se1 = 0.179, se2 = 0.174, alternative = "less")
This function computes combined p-values, point estimates, and confidence intervals based on two parameter estimates using fixed-effect meta-analysis, the two-trials rule, Edgington's, Fisher's, Pearson's, and Tippett's combination methods
twotrials(null = 0, t1, t2, se1, se2, alternative = "greater", level = 0.95)twotrials(null = 0, t1, t2, se1, se2, alternative = "greater", level = 0.95)
null |
Null value for which p-values should be computed. Defaults to
|
t1 |
Parameter estimate from trial 1 |
t2 |
Parameter estimate from trial 2 |
se1 |
Standard error of the parameter estimate from trial 1 |
se2 |
Standard error of the parameter estimate from trial 2 |
alternative |
One-sided alternative hypothesis. Can be either
|
level |
Confidence interval level. Defaults to |
Object of class "twotrials", which is a list of the supplied
arguments augmented with pfuns and ipfuns (combined and
individual p-value functions), mufuns and imufuns (combined
and individual estimation functions), and summaries and
isummaries (combined and individual confidence intervals, point
estimates, p-values, implicit weights) elements
Samuel Pawel
pEdgington, muEdgington,
pMA, muMA, pTippett,
muTippett, p2TR, mu2TR,
pFisher, muFisher, pPearson,
muPearson, plot.twotrials,
print.twotrials
## logRR estimates from RESPIRE trials twotrials(null = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less", level = 0.95) ## compute 99.875% CIs instead twotrials(null = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less", level = 0.99875)## logRR estimates from RESPIRE trials twotrials(null = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less", level = 0.95) ## compute 99.875% CIs instead twotrials(null = 0, t1 = -0.4942, t2 = -0.1847, se1 = 0.1833, se2 = 0.1738, alternative = "less", level = 0.99875)