-
Notifications
You must be signed in to change notification settings - Fork 10
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
Enable single Surv
object as the reponse in a formula for orsf()
#11
Comments
Absolutely - that makes sense to me. I will make an update soon. |
Awesome, thank you! 🙌 |
bcjaeger
added a commit
that referenced
this issue
Nov 2, 2022
bcjaeger
added a commit
that referenced
this issue
Nov 2, 2022
Should be good to go now. Thank you for the suggestion and the great example! library(aorsf)
library(survival)
lung_orsf <- na.omit(lung)
lung_orsf$surv <- Surv(lung_orsf$time, lung_orsf$status)
lung_orsf <- lung_orsf[, -c(2,3)]
fit <- orsf(lung_orsf, formula = surv ~ age + ph.ecog)
predict(fit, new_data = lung_orsf[1:5, ])
#> [,1]
#> [1,] 0.3283840
#> [2,] 0.3673719
#> [3,] 0.3346957
#> [4,] 0.4501146
#> [5,] 0.4982628
orsf_vi_negate(fit)
#> ph.ecog age
#> 0.2265581 -0.0412957
orsf_summarize_uni(object = fit, n_variables = 1)
#>
#> -- ph.ecog (VI Rank: 1) -----------------------
#>
#> |---------------- risk ----------------|
#> Value Mean Median 25th % 75th %
#> -1.3 0.2740017 0.2493573 0.2267411 0.3259105
#> 0.06 0.3642472 0.3664885 0.3522197 0.3812756
#>
#> Predicted risk at time t = 268 for top 1 predictors Created on 2022-11-02 by the reprex package (v2.0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd like to use a "pre-made"
Surv
object as the response in the formula interface. Would it be possible to allow for that? For some context, this is to make it easier to use theaorsf
engine in tidymodels' workflow objects.Created on 2022-11-01 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: