Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in isotonic projection in ltmp_survival.R #149

Open
shodaiinose opened this issue Sep 26, 2024 · 1 comment
Open

Error in isotonic projection in ltmp_survival.R #149

shodaiinose opened this issue Sep 26, 2024 · 1 comment

Comments

@shodaiinose
Copy link

Error in the following function (iso_fit$y[i] returns supplied outcomes):
isotonic_projection <- function(x, alpha = 0.05) {
cv <- abs(qnorm(p = alpha / 2))
estim <- tidy.lmtp_survival(x)
iso_fit <- isotone::gpava(1:length(x), estim$estimate)
for (i in seq_along(x)) {
x[[i]]$theta <- iso_fit$y[i]
x[[i]]$low <- x[[i]]$theta - (qnorm(0.975) * x[[i]]$standard_error)
x[[i]]$high <- x[[i]]$theta + (qnorm(0.975) * x[[i]]$standard_error)
}
x
}

Potential fix:
isotonic_projection <- function(x, alpha = 0.05) {
cv <- abs(qnorm(p = alpha / 2))
estim <- tidy.lmtp_survival(x)
iso_fit <- isotone::gpava(1:length(x), 1 - estim$estimate)
for (i in seq_along(x)) {
x[[i]]$theta <- 1 - iso_fit$x[i]
x[[i]]$low <- x[[i]]$theta - (qnorm(0.975) * x[[i]]$standard_error)
x[[i]]$high <- x[[i]]$theta + (qnorm(0.975) * x[[i]]$standard_error)
}
x
}

@nt-williams
Copy link
Owner

nt-williams commented Sep 26, 2024

Fixed in devel

Note to self: fix still needs to be propagated through other branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants