View source: R/power.lwyy.test.R
| power.lwyy.test | R Documentation |
Function to compute power at one-sided Type I control level alp/2 or
determine parameters to target given power to test the hypotheses
H0: RR = 1 vs HA: RR < 1 for the LWYY (Andersen-Gill with robust standard
errors) model.
power.lwyy.test(
N = NULL,
RR = NULL,
bta1 = NULL,
thta,
L = NULL,
tau = NULL,
lam = NULL,
alp = 0.05,
pow = NULL,
ar = 0.5,
frailty.type = c("unblind", "blind"),
lam.type = c("base", "pool")
)
N |
Sample size. |
RR, bta1 |
Rate ratio, log-transform of rate ratio. Provide at most one of RR and bta1. |
thta |
Variance of frailty parameter. |
L |
Number of events. |
tau |
Expected follow-up time. |
lam |
Event rate. If lam.type = "base", it is the event rate for control. If lam.type = "pool", it is the pooled rate. |
alp |
Two-sided alpha-level. |
pow |
Target power. |
ar |
Allocation ratio (Number control / Total) |
frailty.type |
Indicates whether frailty variance is based on blinded information ("blind") or unblinded ("unblind"). Default "unblind". |
lam.type |
Indicates whether event rate is based on control rate ("base") or pooled rate ("pool"). Ignored if lam = NULL. Default "base". |
An object of class "power.lwyytest" has the following components:
method: Description of the test.
N: Total sample size. N = Nc + Nt, where Nc = ar * N is the number on control and Nt = (1-ar) * N is the number on treatment.
RR, RRCV: Rate ratio powered for and critical value for rate ratio.
bta1, bta1CV: The log of RR, RRCV.
thta: The variance of the frailty parameter.
thtap: If frailty.type = "blind", the input variance from a blinded source.
L: Number of events. Note that all else being equal, an increase (decrease) in N requires a decrease (increase) in L.
tau, lam0: The mean follow-up time and control event rate. Note if tau = 1, then lam0 may be interpreted as mean cumulative intensity on control.
lamp: If lam.type = "pool" and argument lam is not null, the input rate from a blinded source.
alp: alp/2 is the one-sided Type I control level of the test H0: RR = 1 vs HA: RR < 1.
pow: Power of the test.
ar: Allocation to control ratio Nc/N.
note: Set of key notes about the assessment.
An object of class "power.lwyytest", a list of arguments, including those computed, with method and note elements.
x = power.lwyy.test(N = 1000, RR = 0.8, thta = 1, L = 1000, tau = 0.9, alp = 0.05, ar = 0.5)
print(x)
x = power.lwyy.test(N = 1000, RR = 0.8, thta = 1, tau = 0.9, lam = 1.23, alp = 0.05, ar = 0.5)
print(x)
x = power.lwyy.test(N = 1000, RR = 0.8, thta = 1, tau = NULL, lam = 1.23, alp = 0.05, ar = 0.5)
print(x, digits = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.