Package 'designsize'

Title: Sample Size Calculation of Various Study Designs
Description: Different sample size calculations with different study designs. These techniques are explained by Chow (2007) <doi:10.1201/9781584889830>.
Authors: Atanu Bhattacharjee [aut, cre, ctb], Rajashree Dey [aut, ctb], Soutik Halder [aut, ctb], Akash Pawar [aut, ctb]
Maintainer: Atanu Bhattacharjee <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2024-11-17 03:08:26 UTC
Source: https://github.com/cran/designsize

Help Index


Sample size determination for A + B escalation design without dose de-escalation

Description

Determination of sample size for each dose level using A + B escalation design without dose de-escalation

Usage

ABdesign(A, B, C, D, E, prop=c())

Arguments

A

Number patients at the dose level i

B

Number of patients add at the dose level i when more than D number of patients have DLT

C

Predetermined number patients out of A.

D

Predetermined number patients out of A and D>=C

E

Predetermined number patients out of A+B and E>=D

prop

Vector of DLT rates at different dose level

Details

Let there are "A" patients at the dose level "i" and also consider "C" and "D" as predetermined value where (D >= C).

If less than C patients have DLTs out of A patints then we escalate the dose at (i+1)th level and if more than D have the DLT's out of A then we consider the previous dose level (i-1)th as MTD(maximum dose level with toxicity rates occurring no more than a predetermined value).

If more than C and less than D patients have DLTs then we add B more patients at the ith dose level and then if more than E (E >= D) out of (A+B) patients have the DLTs then we consider the previous dose level as MTD.

Now we are going to determine the expected number of sample size at the jth dose level.

# prop = Vector of DLT rates at different dose level

# n = Total number of doses

# N = Vector of expected number of patients at different level of doses

Value

The expected number of patients at dose levels

Author(s)

Atanu Bhattacharjee, Rajashree Dey ,Soutik Halder and Akash Pawar

See Also

crt.match crt.unmatch phsize precsize

Examples

# This is A+B escalation design without dose de-escalation. Here A=3 , B=3 indicates the
# number of patients at the  dose level i and taking C=D=E=1 the predetermined number of
# patients with DLT. Prop indicates the vector of the DLT rates at different dose level.

ABdesign(A = 3,B = 3,C = 1,D = 1,E = 1,prop= c(0.01,0.014,0.025,0.056,0.177,0.594,0.963))

Sample size determination for crossover study design

Description

Determination of sample sizes for two factors of each group using one of the tests for equality, non-inferiority/superiority or equivalence

Usage

crsize(type, delta, m, k, mur, mut, sigbr, sigbt, rho, sigwr, sigwt,
       alpha, beta, r1, r2)

Arguments

type

The three different types of tests are (1) test for equality, (2) test for non-inferiority/ superiority, (3) test for equivalence i.e. type = c("equal", "noninf.sup", "equiv")

delta

Non-inferiority/Superiority margin

m

Number of responses observed from each subject in each sequence under a fixed treatment

k

Ratio of the sample sizes of the two sequences

mur

Mean value of reference therapy

mut

Mean value of test therapy

sigbr

Between standard deviation due to the effect of reference therapy

sigbt

Between standard deviation due to the effect of test therapy

rho

Correlation between reference and test therapy

sigwr

Within standard deviation due to the effect of reference therapy

sigwt

Within standard deviation due to the effect of test therapy

alpha

Level of significance

beta

The probability of type-II error

r1

Proportion of factor-1

r2

Proportion of factor-2

Details

Consider a 2x2m replicated crossover design for comparing mean responses of a test drug and a reference drug. Under both treatments the design consists of two sequences with m subjects each.

Value

crsize returns the required sample sizes for each sequence and their factors in a 2x2 contingency table.

Author(s)

Atanu Bhattacharjee, Rajashree Dey ,Soutik Halder and Akash Pawar

See Also

ABdesign crt.match crt.unmatch phsize precsize

Examples

# (a) Test for equality:

# This is a crossover design. The type = "equal" tests the equality of mean responses of
# a test drug (mut = 9) and a reference drug (mur = 8.5) and the number of responses are
# m = 4 observed from  each subject in each  sequence. k = 1 indicates the  ratio of the
# sample sizes of the two sequences are equal. The between standard deviation due to the
# effect of reference therapy is sigbr = 1.5 and that of test therapy is 1.5. The corre-
# lation between reference and test  therapy is rho = 0.7. The within standard deviation
# due to the effect of reference therapy is sigwr = 1 as well as test therapy is sigwt =
# 1. The alpha = 0.05 is level of significance and the probability of type - II error is
# beta = 0.10. The proportion  of factor - 1 and factor - 2 are taken to be r1 = 0.5 and
# r2 = 0.5 respectively.


crsize(type= "equal", delta = 0.4, m = 4, k = 1, mur = 8.5, mut = 9, sigbr = 1.5,
       sigbt = 1.5, rho = 0.7, sigwr = 1, sigwt = 1, alpha = 0.05, beta = 0.10,
       r1 = 0.5, r2 = 0.5)


# (b) Test for non-inferiority/superiority:

# This is a crossover design. The type = "noninf.sup", tests  whether the  difference of
# mean responses of a test drug (mut = 9) and a reference drug (mur = 8.5) being greater
# than or equal to  the marginal value delta = 0.4. The  number of  responses are m = 4,
# observed from each subject in each sequence. The value of k = 1 indicates the ratio of
# the sample sizes of the two sequences are equal. The between standard deviation due to
# the effect of  reference  therapy is sigbr = 1.5 and that of  test therapy is 1.5. The
# correlation between reference and test therapy is rho = 0.7. The within standard devi-
# ation due to  the effect of reference therapy is sigwr = 1, as well as test therapy is
# sigwt = 1. A alpha = 0.05 is the level of significance and  the probability of type-II
# error is beta = 0.10. The proportion of factor-1 (r1) and factor-2 (r2) both are taken
# to be 0.5.


crsize(type = "noninf.sup", delta = 0.4, m = 4, k = 1, mur = 8.5, mut = 9, sigbr = 1.5,
       sigbt = 1.5, rho = 0.7, sigwr = 1, sigwt = 1, alpha = 0.05, beta = 0.10,
       r1 = 0.5, r2 = 0.5)



#(c) Test for equivalence:

# This is a crossover design. The type = "equiv" tests whether the absolute value of the
# difference of mean responses of a test drug (mut = 9) and a reference drug (mur = 8.5)
# being  less than or equal to  the marginal value delta = 0.6. The number  of responses
# are m = 4 observed from each subject in each sequence. k = 1, indicates that the ratio
# of the sample sizes of the two sequences are equal. The between standard deviation due
# to the effect of reference therapy is sigbr = 1.5 and that of test therapy is 1.5. The
# correlation between reference and test therapy is rho = 0.7. The within standard devi-
# ation due to  the effect of reference therapy is sigwr = 1 as well as  test therapy is
# sigwt = 1. alpha = 0.05 is  the level of significance and the probability of type - II
# error is beta = 0.10. The proportion of factor-1 (r1) and factor-2 (r2) both are taken
# to be 0.5.


crsize(type = "equiv", delta = 0.6, m = 4, k = 1, mur = 8.5, mut = 9, sigbr = 1.5,
       sigbt = 1.5,rho = 0.7, sigwr = 1, sigwt = 1, alpha = 0.05, beta = 0.10,
       r1 = 0.5, r2 = 0.5)

Cluster numbers determination for cluster randomized trails (CRT) matched case

Description

Determine the number of clusters need per group for matched cluster randomized trails

Usage

crt.match(type, mu1, mu2, alpha, beta, sig.w, sig.bm, m, k)

Arguments

type

There are three types of comparison i.e. type = c("M", "P", "IR"), "M" stands for comparison of means "P" stands for comparison of proportions "IR" stands for comparison of incidence rates

mu1

The mean/proportion/incidence rate value of the 1st group

mu2

The mean/proportion/incidence rate value of the 2nd group

alpha

Level of significance

beta

The probability of type-II error

sig.w

Standard deviation of within cluster

sig.bm

Standard deviation of between cluster

m

Number of subject in each cluster which is person-years in the case of incidence rates

k

Common value of the coefficient of variation for each group

Details

In cluster-randomized trials (CRTs), matching is a technique that can be used to improve covariate balance. Matching protects against chance imbalances in baseline covariate distributions and is thought to improve study credibility. Matching is also implemented to increase study power. Pairs of similar clusters are formed and then one cluster from the pair is randomized to group 1 while the other is assigned to group 2. Now we are going to determine the number of cluster in each group.

Value

crt.match returns a value indicating the number of clusters needed per group

Author(s)

Atanu Bhattacharjee, Rajashree Dey ,Soutik Halder and Akash Pawar

See Also

ABdesign crt.unmatch expsize phsize precsize prsize crsize

Examples

# (a) Comparison of means:

# This is a matched cluster randomized trials. The type ="M" indicates the comparison of
# means. The mean responses of a test group is mu1 = 0.06 and a reference group is mur =
# 0.4. The standard deviationof within cluster and between  cluster are sig.w = 0.69 and
# sig.bm = 0.224 respectively, m = 20 indicates number of subject in each cluster. alpha
# =.05 is the level of significance and the probability of type-II error is beta = 0.10.


crt.match(type="M",mu1=0.6,mu2=0.4,alpha=0.05,beta=0.20,sig.w=0.69,sig.bm=0.224,m=20)


# (b) Comparison of proportions:

# This is a matched  cluster randomized trials. Where type = "P" indicates the tests for
# comparison of proportions. The proportion of a test group is mu1 =0.01 and a reference
# group is mur = 0.0075. The Standard deviation of between cluster is sig.bm=0.224 and m
# = 2750 indicates number of subject in each cluster, alpha = 0.05 is the level of signi
# -ficance and probability of type-II error is beta = 0.10.


crt.match(type="P",mu1=0.01,mu2=0.0075,alpha=0.05,beta=0.10,sig.bm=0.0075,m=2750)


#(c) Comparison of incidence rates:

# This is a matched cluster randomized trials. Where type = "IR" indicates the tests the
# comparison of incidence rates. The incidence rate of a test group is mu1 = 4.5 and for
# reference group is mur = 3.6. A total of m = 50 person years is considered, alpha =.05
# is the level ofsignificance and the probability of type-II error is beta = 0.10. k=0.3
# indicates the common value of the coefficient of variation for each group.


crt.match(type="IR",mu1=4.5,mu2=3.6,alpha=0.05,beta=0.20,m=50,k=0.3)

Cluster number determination for cluster randomized trails (CRT) unmatched case

Description

Determination of number of clusters per group for unmatched cluster randomized trails

Usage

crt.unmatch(type, m, u1, u2, sigma1.B, sigma1.W, sigma2.B, sigma2.W,
            rho1, rho2, alpha, beta)

Arguments

type

There are three different types of comparison i.e. type = c("M", "P", "IR"), "M" stands for comparison of means, "P" stands for comparison of proportions and "IR" stands for comparison of incidence rates

m

A common cluster size

u1

Mean(for M)/proportion(for P)/incidence rate(for IR) of group-1

u2

Mean(for M)/proportion(for P)/incidence rate(for IR) of group-2

sigma1.B

Between-cluster standard deviation of group-1

sigma1.W

Within-cluster standard deviation of group-1

sigma2.B

Between-cluster standard deviation of group-2

sigma2.W

Within-cluster standard deviation of group-2

rho1

Intra-cluster correlation coefficient(ICC) of group-1

rho2

Intra-cluster correlation coefficient(ICC) of group-2

alpha

Level of significance

beta

The probability of type-II error

Details

Instead of independent individuals, the unit of randomization is a group of subjects in a cluster randomized trial(s) or group randomized trial(s). CRTs are generally more complex and the investigators consider the selection of the unit of randomization and the unit of inference, matching or stratification to improve treatment balance across clusters. It is also well known that CRTs need more subjects than individually randomized trials to be adequately powered.

Under unmatched case, no pair of matching is used to control the balance. The simple randomization technique is generally used.

Value

crt.unmatch returns a value indicating the number of clusters needed per group.

Author(s)

Atanu Bhattacharjee, Rajashree Dey ,Soutik Halder and Akash Pawar

See Also

ABdesign crt.match expsize phsize precsize prsize crsize

Examples

# (a) Comparison of means:

# This is a cluster randomized trials for unmatched cases. The type = "M", indicates the
# comparison of means of two groups  taking a common cluster size m = 20. The mean value
# of group-1 and group-2 is u1 = 0.5 and u2 = 0.3 respectively. For group-1, the between
# -cluster standard deviation is sigma1.B = 0.3 and within-cluster standard deviation is
# sigma1.W = 0.3. Similarly, for group-2 those values are sigma2.B=0.3 and sigma2.W=0.3.
# The intra-cluster correlation coefficient (ICC) of group - 1 is rho1 = 0.2 and that of
# group - 2 is rho2 = 0.2. The level of significance is alpha = 0.05 and the probability
# of type-II error is beta = 0.20.


crt.unmatch(type = "M", m = 20, u1 = 0.5, u2 = 0.3, sigma1.B = 0.3, sigma1.W = 0.3,
            sigma2.B = 0.3, sigma2.W = 0.3, rho1 = 0.2, rho2 = 0.2,
            alpha = 0.05, beta = 0.20)


# (b) Comparison of proportions:

# This is a cluster randomized trials for unmatched cases. The type = "P", indicates the
# comparison of proportions of two groups taking a common cluster size m = 20. The prop-
# ortion of group-1 andgroup-2 is u1 = 0.5 and u2 = 0.3 respectively. For group - 1, the
# between-cluster standard deviation is sigma1.B = 0.3 and within-cluster standard devi-
# ation is sigma1.W = 0.3. Similarly, for group-2 the standard deviations are sigma2.B =
# 0.3 and sigma2.W = 0.3. The intra-cluster correlation coefficient(ICC) of group - 1 is
# rho1 = 0.2 and that of group-2 is rho2 = 0.2. The level of significance is alpha =0.05
# and the probability of type-II error is beta = 0.20.


crt.unmatch(type = "P", m = 20, u1 = 0.5, u2 = 0.3, sigma1.B = 0.3, sigma1.W = 0.3,
            sigma2.B = 0.3, sigma2.W = 0.3, rho1 = 0.2, rho2 = 0.2,
            alpha = 0.05, beta = 0.20)


# (c) Comparison of incidence rates:

# This is a cluster randomized trials for unmatched cases. The type = "IR" indicates the
# comparison of incidence rates of two groups taking a total of m = 20 person-years. The
# incidence rate of group-1 and group-2 is u1 = 0.5 and u2 = 0.3 respectively. For group
# -1, the between-cluster standard deviation is sigma1.B = 0.3 and within-cluster stand-
# ard deviation is sigma1.W = 0.3. Similarly, for  group-2  the  standard deviations are
# sigma2.B = 0.3 and sigma2.W = 0.3. The  intra-cluster correlation coefficient (ICC) of
# group-1 is rho1 = 0.2 and  that of group-2 is rho2 = 0.2. The level of significance is
# alpha = 0.05 and the probability of type-II error is beta = 0.20.


crt.unmatch(type = "IR", m = 20, u1 = 0.5, u2 = 0.3, sigma1.B = 0.3, sigma1.W = 0.3,
            sigma2.B = 0.3, sigma2.W = 0.3, rho1 = 0.2, rho2 = 0.2,
            alpha = 0.05, beta = 0.20)

Sample size determination for survival data using exponential assumption

Description

Sample size determination for control drug and test drug for time to event outcome using exponential assumption

Usage

expsize(type, k, delta, lambda1, lambda2, sigma1, sigma2,
        sigma.lambda, alpha, beta)

Arguments

type

There are three different types of comparison tests: (1) test for equality, (2) test for non-inferiority/superiority, (3) test for equivalence, ie. type = c("equal", "noninf.sup", "equiv")

k

Ratio of sample sizes

delta

The superiority or non-inferiority margin

lambda1

Hazard rate of the control drug

lambda2

Hazard rate of the test drug

sigma1

Variability in the hazard rate due to using control drug

sigma2

Variability in the hazard rate due to using test drug

sigma.lambda

Variability in the hazard rate due to combination of control and test drug

alpha

Level of significance

beta

The probability of type-II error

Details

Our aim is to determine the sample size based on the hazard rates for median survival times between control drug and test drug. Since, the hazard function is constant for an exponential distribution, the median survival time is determined by the hazard function. Moreover, comparing the hazard rates between the treatment drugs is our hypothesis of interest.

Value

expsize returns a sample size for control and test drug intervention.

Author(s)

Atanu Bhattacharjee, Rajashree Dey ,Soutik Halder and Akash Pawar

See Also

ABdesign crt.match crt.unmatch phsize precsize prsize crsize

Examples

# (a) Test for equality:

# The exponential assumption is used to determine the  sample size with  null hypothesis
# that the hazard rates of a test drug and a reference drug are equal i.e.type ="equal".
# The both sample sizes are taken to be equal (k = 1). The  hazard rate of  control drug
# is lambda1 = 2 and that of test drug is  lambda2 = 1. The standard deviation (s.d.) in
# hazard rate due to using control drug & test drug is 0.97 and 3.94 respectively. Their
# combined standard deviation is sigma.lambda = 2.56. The level of significance is alpha
# = 0.05 and the probability of type-II error is beta = 0.20.


expsize(type = "equal", k = 1, delta = 0, lambda1 = 2, lambda2 = 1, sigma1 = 0.97,
        sigma2 = 3.94, sigma.lambda = 2.56, alpha = 0.05, beta = 0.20)


# (b) Test for noninferiority/superiority:

# The exponential assumption is used to determine sample size by testing null hypothesis
# (type = "noninf.sup") that the difference  between the hazard rates of a test drug and
# the reference drug is less than or equal to a superiority margin delta = 0.2,where k=1
# indicates both the sample  sizes are taken to be equal. The hazard rate of the control
# drug is lambda1 = 2 and  that of test drug is  lambda2 = 1. The standard  deviation in
# hazard rate due to using control drug & test drug is 0.97 and 3.94 respectively. Their
# combined standard deviation is sigma, lambda =2.56. The level of significance is alpha
# = 0.05 and the probability of type-II error is beta = 0.20.


expsize(type = "noninf.sup", k = 1, delta = 0.2, lambda1 = 2, lambda2 = 1, sigma1 = 0.97,
        sigma2 = 3.94, sigma.lambda = 2.56, alpha = 0.05, beta = 0.20)


 # (c) Test for equivalence:

# The exponential assumption is used to determine sample size by testing null hypothesis
# (type = "equiv") that the absolute difference between the hazard rates of a  test drug
# and a ref drug is greater than or equal to a superiority margin delta =0.5, where k =1
# indicates both the sample  sizes are taken to be equal. The hazard rate of the control
# drug is lambda1 = 2 and  that of test drug is  lambda2 = 1.  The standard deviation in
# the hazard rate  due to using control drug and test drug is 0.97 and 3.94 respectively.
# Their combined standard deviation is sigma.lambda = 2.56. The level of significance is
#  alpha = 0.05 and the probability of type-IIqerror is beta = 0.20.


expsize(type = "equiv", k = 1, delta = 0.5, lambda1 = 2, lambda2 = 1, sigma1 = 0.97,
        sigma2 = 3.94, sigma.lambda = 2.56, alpha = 0.05, beta = 0.20)

Sample size determination using proportional hazard assumption

Description

Determination of sample sizes of the control drug and the test drug intervention for time to event outcome using proportional hazard assumption.

Usage

phsize(type, lambda1, lambda2, delta, prop, d, alpha, beta)

Arguments

type

There are three different types of comparison tests: (1) test for equality, (2) test for non-inferiority/superiority, (3) test for equivalence, ie. type = c("equal", "noninf.sup", "equiv")

lambda1

Hazard rate of the control group

lambda2

Hazard rate of the test group

delta

The inferiority or superiority margin

prop

The proportion of patients in the control group

d

The probability of observing an event

alpha

Level of significance

beta

The probability of type-II error

Details

The proportional hazards assumption is used for comparing time to event data where, we assume that the hazard function is the product of two components. One component is the non-parametric part which is generally called baseline hazard and another one is the parametric part. The covariates of this regression model are included in the later component. Because of the combination of parametric and non-parametric components, the model is known as semi-parametric model.

Value

phsize returns a sample size for the control and the test drug intervention.

Author(s)

Atanu Bhattacharjee, Rajashree Dey ,Soutik Halder and Akash Pawar

See Also

ABdesign crt.match crt.unmatch precsize prsize crsize

Examples

# (a) Test for equality:

# The phsize function determines the sample size using  proportional hazards assumption.
# The type = "equal" denotes the two survival curves are equal under the null hypothesis
# and the hazard rate of the control group is lambda1 = 1 and that of the  test group is
# lambda2 = 2. The proportion of patients in the control group is prop = 0.5. The proba-
# bility of observing an event is 0.8. The level of significance is alpha = 0.05 and the
# probability of type-II error is beta = 0.20.


phsize(type = "equal", lambda1 = 1, lambda2 = 2, delta = 0, prop = 0.5,
       d = 0.8, alpha = 0.05, beta = 0.20)


# (b) Test for non-inferiority/superiority:

# The phsize function determines the sample size using  proportional hazards assumption.
# The type = "noninf.sup" denotes the difference of the two survival curves is less than
# or  equal to the marginal value delta = 0.3. The  hazard rate of  the control group is
# lambda1 = 1 and  that of  the test group is lambda2 = 2. The proportion of patients in
# the control group is prop = 0.5, the probability of observing a event is 0.8 and level
# of significance is alpha = 0.05 and the probability of type-II error is beta = 0.20.


phsize(type = "noninf.sup", lambda1 = 1, lambda2 = 2, delta = 0.3, prop = 0.5,
       d = 0.8, alpha = 0.05, beta = 0.20)


# (c) Test for equivalence:

# The phsize function determines the sample size using  proportional hazards assumption.
# The type = "equiv", denotes whether absolute value of  the differences between the two
# survival curves is greater than or equal to the marginal value delta = 0.5. The hazard
# rate of the  control group is lambda1 = 1 and that of the test group is lambda2 = 2, &
# the proportion of patients in control group is prop = 0.5 and the  probability of obs-
# erving a event ais 0.8. The  level of significance is alpha = 0.05 and the probability
# of type-II error is beta = 0.20.


phsize(type = "equiv", lambda1 = 1, lambda2 = 1, delta = 0.5, prop = 0.5,
       d = 0.8, alpha = 0.05, beta = 0.20)

Sample size determination using power and precision analysis

Description

It determines the ratio between the sample size of power analysis and precision analysis analysis and also, give the required sample sizes.

Usage

precsize(pR, pT, sigr, sigt, c, alpha, beta)

Arguments

pR

Incidence rate for the reference group

pT

Incidence rate for the test group

sigr

Variability in the reference group

sigt

Variability in the test group

c

Constant value for allowance of maximum error margin

alpha

Level of significance

beta

The probability of type-II error

Details

A pre-study power analysis for sample size determination is usually performed to calculate an appropriate sample size for achieving a desired power for detecting a clinically meaningful difference at a prespecified level of significance. In practice, a much larger sample size is expected for detecting a relatively smaller difference, especially for clinical trials with extremely low incidence rate. As a result, sample size determination based on power analysis may not be feasible. So, it is a good suggestion to determine the sample size based on precision analysis.

Value

precsize returns 3 values:

R

Ratio between the sample size of power analysis and precision analysis

n.power

Sample size required for power analysis

n.precision

Sample size required for precision analysis

Author(s)

Atanu Bhattacharjee, Rajashree Dey ,Soutik Halder and Akash Pawar

See Also

ABdesign crt.match crt.unmatch phsize prsize crsize

Examples

# The incidence rate of reference group is pR = 0.8 per thousands and that of test group
# is pT = 0.7 per thousands. It is also assumed that  the respective stanadard deviation
# of reference and test group are sigr = 2 and sigt = 1 respectively. The constant value
# is chosen c = 0.08 to allow the  maximum marginal error. The  level of significance is
# alpha = 0.05 and the probability of type-II error is beta = 0.20.

precsize(pR = 0.8, pT = 0.7, sigr = 2, sigt = 1, c = 0.08, alpha = 0.05, beta = 0.20)

Sample size determination for parallel study design.

Description

Determination of sample sizes of two factors of each of the two groups using one of the tests for equality, non-inferiority/superiority or equivalence.

Usage

prsize(type, mu1, mu2, s, alpha, beta, k, r1, r2, del)

Arguments

type

There are three types of test, (1) test of equality, (2) test for non-inferiority/superiority,

mu1

The mean value of 1st group

mu2

The mean value of 2nd group

s

The common standard deviation

alpha

The level of significance

beta

The probability of the type II error i.e. 1 - power

k

The ratio of 1st sample size(n1) and 2nd sample size(n2) i.e k=n1/n2

r1

The ratio of n1fac1 (sample size of the 1st factor for 1st group) and n1 i.e r1=n1fac1/n1

r2

The ratio of n2fac2 (sample size of the 1st factor for 2nd group) and n2 i.e r2=n2fac1/n2

del

The superiority or non-inferiority margin

Details

Parallel arm design is the most commonly used study design where subjects are randomized to one or more study arms. Each study arm will be allocated a different intervention. After randomization each subject will stay in their assigned arm during the whole study. The randomized subjects should not inadvertently contaminate with the other group. A major characteristic of a parallel study is randomization, which ensures accuracy of the results and lower risk of being biased.

Value

prsize returns returns the required sample sizes for each groups and their factors in a 2x2 contingency table.

Author(s)

Atanu Bhattacharjee, Rajashree Dey ,Soutik Halder and Akash Pawar

See Also

ABdesign crt.match crt.unmatch phsize precsize crsize

Examples

# (a) Test for equality:

# This is a parallel study design. The type = "equal" tests the equality of mean respon-
# ses of a test drug (mu1 = 12) and a reference drug (mur = 8). The common standard dev-
# iation of the drugs is s = 5. k = 2 indicates the ratio of the sample sizes of the two
# groups. alpha = 0.05 is the level of significance and the probability of type-II error
# is beta = 0.10. The proportion  of factor- 1 and factor-2 are taken to be r1 = 0.6 and
# r2 = 0.6 respectively.


 prsize(type="equal", mu1=12, mu2=8, s=5, alpha=0.05, beta=0.10, k=2, r1=0.6, r2=0.6)


 # (b) Test for superiority/noninferiority:

# This is a Parallel design. The type = "noninf.sup" test whether the difference of mean
# responses  of a test drug (mu1 = 12) and a reference drug (mu2 = 8) being greater than
# or equal to the marginal value delta = 0.8. s = 5 is the  common standard deviation of
# the drugs. The value k = 2 indicates the ratio of the  sample sizes of the two groups.
# alpha = 0.05 is the level of significance and the probability of type-II error is beta
# = 0.10. The proportion  of factor-1 and factor-2 are taken to be r1 = 0.6 and r2 = 0.6
# respectively.


 prsize(type="noninf.sup", mu1=12, mu2=8, s=5, alpha=0.05, beta=0.10, k=2, r1=0.6,
        r2=0.6, del=0.8)


# (c) Test for equivalence:

# This is a Parallel design. The type = "equiv" tests  whether the absolute value of the
#  difference of mean responses of a test drug (mu1 = 12) and a reference drug (mu2 = 8)
# being less  than or equal to the  marginal value delta = 0.8. The  number of responses
# are m = 4 observed from each subject in each sequence.The s = 5 is the common standard
# deviation of the drugs. The value k = 2 indicates the ratio of the sample sizes of the
# two groups. The alpha = 0.05 is the level of significance and the  probability of type
# -II error is  beta = 0.10. The proportion  of factor-1 (r1) and factor-2 (r2) both are
# taken to be equal to 0.6.


 prsize(type="equiv", mu1=12, mu2=8, s=5, alpha=0.05, beta=0.10, k=2, r1=0.6,
        r2=0.6, del=0.8)