Skip to content

Commit

Permalink
version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Layla Parast authored and cran-robot committed Oct 29, 2017
0 parents commit be8b492
Show file tree
Hide file tree
Showing 23 changed files with 1,628 additions and 0 deletions.
15 changes: 15 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Package: SurrogateTest
Type: Package
Title: Early Testing for a Treatment Effect using Surrogate Marker
Information
Version: 1.0
Date: 2017-10-27
Author: Layla Parast
Maintainer: Layla Parast <parast@rand.org>
Description: Provides functions to test for a treatment effect in terms of the difference in survival between a treatment group and a control group using surrogate marker information obtained at some early time point in a time-to-event outcome setting. Nonparametric kernel estimation is used to estimate the test statistic and perturbation resampling is used for variance estimation. More details will be available in the future in: Parast L, Cai T, Tian L (2017) "Using a Surrogate Marker for Early Testing of a Treatment Effect" (under review).
License: GPL
Imports: stats, survival
NeedsCompilation: no
Packaged: 2017-10-27 22:12:17 UTC; parast
Repository: CRAN
Date/Publication: 2017-10-29 12:49:05 UTC
22 changes: 22 additions & 0 deletions MD5
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
10d0d0d3b43b55b420faf2d6d249e50c *DESCRIPTION
45214add8e5de36bef55da759d880fc0 *NAMESPACE
92a456409d4c1f259471ddc8a3b78bad *R/Functions_SurrogateTest.R
3195bd13da62111b2183a85569038258 *data/dataA.RData
9b371c1ce1afa731a856fd90960321c9 *data/dataB.RData
0e6b97a74d8a9fb00e3429220af41321 *man/Kern.FUN.Rd
32112c3a9d273321229acd38d8b662c0 *man/VTM.Rd
77a2efdf23dec3b68cbf935c68e08c17 *man/censor.weight.Rd
664fddc77f912e2d675a4316e139b68f *man/cumsum2.Rd
41748c4034dd80eaff977c504e04e9e9 *man/dataA.Rd
d0695be078b9719316cfc511dc80a29b *man/dataB.Rd
3f44c10ddc00b5ca7e650d5d07e58d8b *man/delta.ea.single.Rd
a849ac738665d3e78ec6249eabd6c5b3 *man/delta.eb.single.Rd
866ebbb68f085b04d7e1c8f65f9efa7d *man/delta.estimate.Rd
cd05713178adcc175ee3771b87406a11 *man/design.study.Rd
5434756e7f2139515faf8d9a69d7b0e4 *man/early.delta.test.Rd
9edc751959b9589fafd8ba0f8bddbdfa *man/helper.si.Rd
e83c8752610300c075e1cf64bbcf8d77 *man/int.hazc.Rd
934728f7085c4143bee1c1a277546e55 *man/int.hazc.plan.Rd
83ebfd07a0170d484334e5ee8df83335 *man/pred.smooth.surv.new.Rd
f12e85571e7db2d5c7de878c3cc71ced *man/recover.B.Rd
7f3f8539bbae004c0055c33dfab61504 *man/var.delta.eb.Rd
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
importFrom(stats, bw.nrd, dnorm, pnorm, quantile, rexp, sd, var, approx, pexp, qnorm)
importFrom(survival, survfit, Surv)

exportPattern("^[[:alpha:]]+")
349 changes: 349 additions & 0 deletions R/Functions_SurrogateTest.R

Large diffs are not rendered by default.

Binary file added data/dataA.RData
Binary file not shown.
Binary file added data/dataB.RData
Binary file not shown.
50 changes: 50 additions & 0 deletions man/Kern.FUN.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
\name{Kern.FUN}
\alias{Kern.FUN}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
%% ~~function to do ... ~~
Calculates kernel matrix
}
\description{
%% ~~ A concise (1-5 lines) description of what the function does. ~~
Helper function; this calculates the kernel matrix
}
\usage{
Kern.FUN(zz, zi, bw, kern0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{zz}{
%% ~~Describe \code{zz} here~~
zz
}
\item{zi}{
%% ~~Describe \code{zi} here~~
zi
}
\item{bw}{
%% ~~Describe \code{bw} here~~
bandwidth
}
\item{kern0}{
%% ~~Describe \code{bw} here~~
kernel distribution
}
}
\value{
%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
the kernel matrix
}
\author{
%% ~~who you are~~
Layla Parast
}
\keyword{smooth}
\keyword{robust}
\keyword{nonparametric}
\keyword{internal}
% __ONLY ONE__ keyword per line
35 changes: 35 additions & 0 deletions man/VTM.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
\name{VTM}
\alias{VTM}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
%% ~~function to do ... ~~
Repeats a row.
}
\description{
%% ~~ A concise (1-5 lines) description of what the function does. ~~
Helper function; this function creates a matrix that repeats vc, dm times where each row is equal to the vc vector.
}
\usage{
VTM(vc, dm)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{vc}{
%% ~~Describe \code{vc} here~~
the vector to repeat.
}
\item{dm}{
%% ~~Describe \code{dm} here~~
number of rows.
}
}
\value{
%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
a matrix that repeats vc, dm times where each row is equal to the vc vector
}
\keyword{array}
\keyword{internal}
60 changes: 60 additions & 0 deletions man/censor.weight.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
\name{censor.weight}
\alias{censor.weight}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
%% ~~function to do ... ~~
Calculates censoring probability for weighting
}
\description{
%% ~~ A concise (1-5 lines) description of what the function does. ~~
Helper function; calculates censoring probability needed for inverse probability of censoring weighting
}
\usage{
censor.weight(data.x, data.delta, t, weight = NULL)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{data.x}{
%% ~~Describe \code{data.x} here~~
numeric vector, the observed event time: X = min(T, C) where T is the time of the primary outcome, C is the censoring time
}
\item{data.delta}{
%% ~~Describe \code{data.delta} here~~
numeric vector of 0/1, the censoring indicator: D = I(T<C) where T is the time of the primary outcome, C is the censoring time
}
\item{t}{
%% ~~Describe \code{t} here~~
number, the time of interest
}
\item{weight}{
%% ~~Describe \code{weight} here~~
a numeric vector or matrix of weights used for perturbation-resampling, default is null.

}
}
\details{
%% ~~ If necessary, more details than the description above ~~
Computes the Kaplan Meier estimate of survival for the censoring random variable at the specified time
}
\value{
%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
Kaplan Meier estimate of survival for censoring at time t

}
\author{
%% ~~who you are~~
Layla Parast
}
\examples{
data(dataA)
censor.weight(data.x = dataA$x1, data.delta = dataA$delta1, t=0.5)

}

\keyword{nonparametric}
\keyword{survival}
\keyword{internal}
38 changes: 38 additions & 0 deletions man/cumsum2.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
\name{cumsum2}
\alias{cumsum2}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
%% ~~function to do ... ~~
Helper function

}
\description{
%% ~~ A concise (1-5 lines) description of what the function does. ~~
Helper function; should not be called directly by user.
}
\usage{
cumsum2(mydat)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{mydat}{ mydat
%% ~~Describe \code{mydat} here~~
}
}
\value{
%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
\item{out}{matrix}

}
\author{
%% ~~who you are~~
Layla Parast
}
\keyword{arith}
\keyword{internal}
%% ~Make other sections like Warning with \section{Warning }{....} ~

29 changes: 29 additions & 0 deletions man/dataA.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
\name{dataA}
\alias{dataA}
\docType{data}
\title{
Hypothetical Study A data
}
\description{
Hypothetical Study A data to be used in examples; t=1 and the landmark time = 0.50.

}
\usage{data(dataA)}
\format{
A list with 6 elements representing 1000 observations from a control group and 1000 observations from a treatment group:
\describe{
\item{\code{s1}}{Surrogate marker measurement for treated observations; this marker is measured at time = 0.5. For observations that experience the primary outcome or are censored before 0.5, this value is NA.}
\item{\code{x1}}{The observed event or censoring time for treated observations; X = min(T, C) where T is the time of the primary outcome and C is the censoring time.}
\item{\code{delta1}}{The indicator identifying whether the treated observation was observed to have the event or was censored; D =1*(T<C) where T is the time of the primary outcome and C is the censoring time.}
\item{\code{s0}}{Surrogate marker measurement for control observations; this marker is measured at time = 0.5. For observations that experience the primary outcome or are censored before 0.5, this value is NA.}
\item{\code{x0}}{The observed event or censoring time for control observations; X = min(T, C) where T is the time of the primary outcome and C is the censoring time.}
\item{\code{delta0}}{The indicator identifying whether the control observation was observed to have the event or was censored; D =1*(T<C) where T is the time of the primary outcome and C is the censoring time.}
}}
\details{
Note that if the observation is censored or experienced the primary outcome before the landmark time of 0.50, the surrogate marker measurement is not observed and coded NA.
}
\examples{
data(dataA)
names(dataA)
}
\keyword{datasets}
28 changes: 28 additions & 0 deletions man/dataB.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
\name{dataB}
\alias{dataB}
\docType{data}
\title{
Hypothetical Study B data
}
\description{
Hypothetical Study B data to be used in examples; landmark time = 0.50.
}
\usage{data(dataB)}
\format{
A list with 6 elements representing 1000 observations from a control group and 1000 observations from a treatment group:
\describe{
\item{\code{s1}}{Surrogate marker measurement for treated observations; this marker is measured at time = 0.5. For observations that experience the primary outcome or are censored before 0.5, this value is NA.}
\item{\code{x1}}{The observed event or censoring time for treated observations; X = min(T, C) where T is the time of the primary outcome and C is the censoring time. This time is administratively censored at 0.55 (see details).}
\item{\code{delta1}}{The indicator identifying whether the treated observation was observed to have the event or was censored; D =1*(T<C) where T is the time of the primary outcome and C is the censoring time.}
\item{\code{s0}}{Surrogate marker measurement for control observations; this marker is measured at time = 0.5. For observations that experience the primary outcome or are censored before 0.5, this value is NA.}
\item{\code{x0}}{The observed event or censoring time for control observations; X = min(T, C) where T is the time of the primary outcome and C is the censoring time. This time is administratively censored at 0.55 (see details).}
\item{\code{delta0}}{The indicator identifying whether the control observation was observed to have the event or was censored; D =1*(T<C) where T is the time of the primary outcome and C is the censoring time.}
}}
\details{
Note that if the observation is censored or experienced the primary outcome before the landmark time of 0.50, the surrogate marker measurement is not observed and coded NA. In addition, Study B data is only observed up to the landmark time plus some epsilon, here epsilon=0.05 such that all observations are essentially adminstratively censored at time=0.55.
}
\examples{
data(dataB)
names(dataB)
}
\keyword{datasets}

0 comments on commit be8b492

Please sign in to comment.