Skip to content

Commit

Permalink
varying trial size and refs
Browse files Browse the repository at this point in the history
  • Loading branch information
federicorotolo committed Jul 6, 2017
1 parent ec9ac30 commit 26cd3df
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 27 deletions.
13 changes: 7 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: surrosurv
Type: Package
Title: Evaluation of Failure Time Surrogate Endpoints in Individual Patient Data
Meta-Analyses
Version: 1.1.20
Date: 2017-06-21
Version: 1.1.22
Date: 2017-06-26
Authors@R: c(
person("Federico", "Rotolo", email="[email protected]",
role=c("aut", "cre")),
Expand All @@ -16,11 +16,12 @@ Author: Federico Rotolo [aut, cre],
Maintainer: Federico Rotolo <[email protected]>
Description: Provides functions for the evaluation of
surrogate endpoints when both the surrogate and the true endpoint are failure
time variables. The approaches implemented are: (1) the two-step approach
(Burzykowski et al, 2001) <DOI:10.1111/1467-9876.00244> with a copula model (Clayton, Plackett, Hougaard) at
time variables. The approaches implemented are:
(1) the two-step approach (Burzykowski et al, 2001) <DOI:10.1111/1467-9876.00244> with a copula model (Clayton, Plackett, Hougaard) at
the first step and either a linear regression of log-hazard ratios at the second
step (either adjusted or not for measurement error); (2) mixed proportional
hazard models estimated via mixed Poisson GLM.
step (either adjusted or not for measurement error);
(2) mixed proportional hazard models estimated via mixed Poisson GLM
(Rotolo et al, 2017 <DOI:10.1177/0962280217718582>).
Depends: R (>= 2.10), stats, optimx, grDevices
Imports:
copula,
Expand Down
21 changes: 12 additions & 9 deletions R/loocv.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,16 @@ loocv.data.frame <- function(object,
redobject$trialref <- factor(redobject$trialref)
predint <- tryCatch(
expr = {
surrofit <-
surrosurv(data = redobject, models = models2predict, ...)
res <-
lapply(attr(predict(surrofit), 'predf'), function(x)
x(alpha))
surrofit <- surrosurv(data = redobject, models = models2predict, ...)
res <- lapply(attr(predict(surrofit), 'predf'), function(x) x(alpha))
names <- names(res)
res <- lapply(1:length(res), function(i)
rbind(res[[i]], t(print(
surrofit, silent = TRUE
))[, i, drop = FALSE]))
names(res) <- names
attr(res, 'convergence') <- convergence(surrofit)
attr(res, 'convals') <- convals(surrofit)
res
},
error = function(e) {
Expand All @@ -124,18 +123,23 @@ loocv.data.frame <- function(object,
models2predict <- c(models2predict[0:(poipos - 1)],
paste0('Poisson', c('T', 'TI', 'TIa')))
}
return(mapply(function(i)
res <- mapply(function(i)
return(t(t(c(fit = NA,
lwr = NA,
upr = NA,
kTau = NA,
R2 = NA)
))),
models2predict, SIMPLIFY = FALSE))
models2predict, SIMPLIFY = FALSE)
attr(res, 'convergence') <- attr(res, 'convals') <-
matrix(NA, length(models2predict), 3)
return(res)
}
)
RES <- c(list(margPars = c(alpha = alpha, beta = beta)),
predint)
attr(RES, 'convergence') <- attr(predint, 'convergence')
attr(RES, 'convals') <- attr(predint, 'convals')
return(RES)
}

Expand All @@ -147,8 +151,7 @@ loocv.data.frame <- function(object,
}
clusterEvalQ(cl, library('survival'))
clusterEvalQ(cl, library('surrosurv'))
loocvRES <-
clusterApplyLB(cl, levels(object$trialref), loof, ...)
loocvRES <- clusterApplyLB(cl, levels(object$trialref), loof, ...)
stopCluster(cl)
rm(cl)

Expand Down
6 changes: 3 additions & 3 deletions R/simData.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kTaus <- Vectorize(function(lnSigma2)
# plot(exp(logsigma2), kTaus_ln(logsigma2))

find.sigma2 <- function(tau) {
loss <- function(x)
loss <- function(x)
(kTaus(x) - tau) ^ 2
RES <- optimize(loss, c(-10, 4))
return(exp(RES$minimum))
Expand Down Expand Up @@ -49,9 +49,9 @@ simData <- function(method = c('re', 'cc', 'mx')) {
) {

if (length(gammaWei) == 1)
gammaWei <- rep(gammaWei, 2)
gammaWei <- rep(gammaWei, 2)

if (!nifix) ni <- round(runif(N, ni * .75, ni * 1.25))
if (!nifix) ni <- round(runif(N, ni * .5, ni * 1.5))
trialref <- unlist(mapply(rep, 1:N, each = ni))

data <- data.frame(trialref = factor(trialref),
Expand Down
10 changes: 9 additions & 1 deletion man/simData.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,18 @@ simData.mx(R2 = 0.6, N = 30, ni = 200,
Burzykowski T, Cortinas Abrahantes J (2005). Validation in the case of two failure-time endpoints.
In \emph{The Evaluation of Surrogate Endpoints} (pp. 163-194). Springer, New York.
Rotolo F, Paoletti X, Burzykowski T, Buyse M, Michiels S.
A Poisson approach for the validation of failure time surrogate endpoints
in individual patient data meta-analyses.
\emph{Statistical Methhods in Medical Research} 2017;
\bold{In Press}.
\doi{10.1177/0962280217718582}
Shi Q, Renfro LA, Bot BM, Burzykowski T, Buyse M, Sargent DJ.
Comparative assessment of trial-level surrogacy measures for candidate
time-to-event surrogate endpoints in clinical trials.
\emph{Computational Statistics & Data Analysis} 2011; 55: 2748--2757.
\emph{Computational Statistics & Data Analysis} 2011;
\bold{55}: 2748--2757.
}
\author{
Expand Down
10 changes: 6 additions & 4 deletions man/surrosurv-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
}
\references{
Rotolo F, Paoletti X, Burzykowski T, Buyse M, Michiels S.
Evaluation of failure time surrogate endpoints in individual patient data meta-analyses
of randomized clinical trials. A Poisson approach.
\emph{Working paper}.
A Poisson approach for the validation of failure time surrogate endpoints
in individual patient data meta-analyses.
\emph{Statistical Methhods in Medical Research} 2017;
\bold{In Press}.
\doi{10.1177/0962280217718582}

Burzykowski T, Molenberghs G, Buyse M et al.
Validation of surrogate end points in multiple randomized clinical trials with failure time end points.
\emph{Journal of the Royal Statistical Society C} 2001;
\bold{50}:405--422.
\doi{10.1111/1467-9876.00244}.
\doi{10.1111/1467-9876.00244}

Gasparrini A, Armstrong B, Kenward MG.
Multivariate meta-analysis for non-linear and other multi-parameter associations.
Expand Down
10 changes: 6 additions & 4 deletions man/surrosurv.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,12 @@ surrosurv(data,
\emph{Journal of the America Statistical Association} 1965; \bold{60}:516--522.
\doi{10.1080/01621459.1965.10480807}

Rotolo F, Paoletti X, Burzykowski T, Buyse M, Michiels S.
Evaluation of failure time surrogate endpoints in individual patient data
meta-analyses of randomized clinical trials. A Poisson approach.
\emph{Working paper}.
Rotolo F, Paoletti X, Burzykowski T, Buyse M, Michiels S.
A Poisson approach for the validation of failure time surrogate endpoints
in individual patient data meta-analyses.
\emph{Statistical Methhods in Medical Research} 2017;
\bold{In Press}.
\doi{10.1177/0962280217718582}

Shih JH, Louis TA.
Inferences on the Association Parameter in Copula Models
Expand Down

0 comments on commit 26cd3df

Please sign in to comment.