Skip to content
Snippets Groups Projects
Commit 4508f386 authored by Fabio Molo's avatar Fabio Molo
Browse files

update package

parent 11e3626e
Branches equivalence-normal
No related tags found
1 merge request!2Chapter 4
Package: samplesizeCT
Version: 0.1.1
Version: 0.1.2
Date: 2024-03-19
Authors@R:
c(person(given = "Fabio",
......
......@@ -5,7 +5,7 @@
## ----------------------------------------------------------------------------
PACKAGE = samplesizeCT
VERSION = 0.1.1
VERSION = 0.1.2
TAR = $(PACKAGE)_$(VERSION).tar.gz
all: build
......
# Generated by roxygen2: do not edit by hand
export(sampleSizeCrossOver)
export(sampleSizeParallel)
export(sampleSizeRClust)
export(sampleSizeZtest)
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sampleSizeCrossOver.R
\name{sampleSizeCrossOver}
\alias{sampleSizeCrossOver}
\title{Sample size for a Cross Over Trial}
\usage{
sampleSizeCrossOver(
delta,
sd.w,
sig.level = 0.05,
power = 0.9,
evaluable.ss = FALSE
)
}
\arguments{
\item{delta}{The within-subject estimate of the difference in treatment means}
\item{sd.w}{The within-subject standard deviation}
\item{sig.level}{Significance level (alpha), i.e., the probability of a type
I error.}
\item{power}{Power, i.e., (1 - the probability of a type II error).}
\item{evaluable.ss}{Evaluable sample size, can be either TRUE or FALSE. If TRUE, returns evaluable
sample size. Otherwise, returns sample size.}
}
\value{
Named vector of length 1 with total sample size for a cross-over trial
}
\description{
Compute the total sample size for a cross over trial in two
normally distributed populations. Chapter 4 in Julious (2023).
}
\details{
For two samples from a cross-over trial,
\code{sampleSizeCrossOver} returns the sample size required in a test for a
difference in within-subject means. Note that with cross-over trials,
unlike parallel group trials, there is no allocation ratio as in a cross-over trial;
the meaning of r would be the allocation ratio per treatment sequence AB and BA.
}
\examples{
## example from Julious (2023), Section 4.2.6, p. 77/78.
sampleSizeCrossOver(delta = 1, sd.w = 0.99, sig.level = 0.05, power = 0.9)
}
\references{
Julious, S. A. (2023). \emph{Sample Sizes for Clinical Trials}, CRC
Press, 2nd edition, p. 55. equ. (3.3), \doi{10.1201/9780429503658}.
}
\author{
Pilar Pastor \email{pilar.pastormartinez@uzh.ch}, Samuel Pawel
\email{samuel.pawel@uzh.ch}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sampleSizeRClust.R
\name{sampleSizeRClust}
\alias{sampleSizeRClust}
\title{Sample size for a Cluster Randomized trial}
\usage{
sampleSizeRClust(
delta,
sd,
sig.level = 0.05,
power = 0.9,
alternative = c("two.sided", "one.sided"),
r = 1,
m,
icc,
rho = 1,
type = c("standard", "baseline", "one.arm", "cross.over")
)
}
\arguments{
\item{delta}{The true difference in means under the alternative hypothesis.}
\item{sd}{Population standard deviation, assumed to be equal for both
populations.}
\item{sig.level}{Significance level (alpha), i.e., the probability of a type
I error.}
\item{power}{Power, i.e., (1 - the probability of a type II error).}
\item{alternative}{Direction of the alternative. Can be either \code{"two.sided"}
or \code{"one.sided"}.}
\item{r}{Allocation ratio, i.e., the sample size in population A is r times
the sample size in population B. The default is 1 for equal sample sizes.}
\item{m}{size of the clusters}
\item{icc}{intraclass correlation coefficient}
\item{rho}{correlation in responses for individuals within the trial}
\item{type}{type of randomization can be \code{"standard"}, \code{"baseline"} (if
availability of baseline data), \code{"one.arm"} (if 'therapist effect' must be
taken into consideration) and \code{"cross.over"}}
}
\value{
Named vector of length 2 with sample sizes for groups A and B
}
\description{
Compute the sample size for each arm of a cluster randomized trial
in two normally distributed populations
}
\details{
For two samples from normally distributed populations A and B,
\code{sampleSizeRClust} returns the sample size required in a cluster randomized trial for
each treatment and the number of clusters k. Note that for \code{alternative = "two.sided"}
the probability of rejection in the opposite direction of the true
difference is ignored (see documentation of the argument \code{strict} in
\link[stats]{power.t.test} for details).
Also note that the type of randomization can also be specified depending on
the availability of baseline data, one arm or cross over design. With
\code{type = "standard"} as default
}
\examples{
## example from Julious (2023), Section 5.3.2.1, p. 85/86.
sampleSizeRClust(delta = 0.5, sd = 2.25, sig.level = 0.05, power = 0.9,
alternative = "two.sided", r = 1, m = 10, icc = 0.05,
type = "standard")
}
\references{
Julious, S. A. (2023). \emph{Sample Sizes for Clinical Trials}, CRC
Press, 2nd edition, p. 55. equ. (3.3), \doi{10.1201/9780429503658}.
}
\author{
Pilar Pastor \email{pilar.pastormartinez@uzh.ch}, Samuel Pawel
\email{samuel.pawel@uzh.ch}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment