Skip to content

Pred_spec_auto and character values #68

Description

@DustinMLong

See below.

library(aorsf)

fit = orsf(pbc_orsf, time + status ~ . - id)

orsf_pd_oob(fit, pred_spec = pred_spec_auto(age))
#>    pred_horizon      age      mean        lwr      medn       upr
#> 1:         1788 35.66324 0.2702930 0.01283832 0.1639040 0.8902918
#> 2:         1788 41.51266 0.2811068 0.01250296 0.1799548 0.8988816
#> 3:         1788 49.70979 0.3068783 0.01287180 0.2048165 0.9127864
#> 4:         1788 56.58453 0.3361083 0.01693452 0.2480658 0.9267214
#> 5:         1788 62.88433 0.3667286 0.02749217 0.2945945 0.9229582

orsf_pd_oob(fit, pred_spec = pred_spec_auto("age"))
#>    pred_horizon      age      mean        lwr      medn       upr
#> 1:         1788 35.66324 0.2702930 0.01283832 0.1639040 0.8902918
#> 2:         1788 41.51266 0.2811068 0.01250296 0.1799548 0.8988816
#> 3:         1788 49.70979 0.3068783 0.01287180 0.2048165 0.9127864
#> 4:         1788 56.58453 0.3361083 0.01693452 0.2480658 0.9267214
#> 5:         1788 62.88433 0.3667286 0.02749217 0.2945945 0.9229582

bob = "age"

orsf_pd_oob(fit, pred_spec = pred_spec_auto(bob))
#> Error: variables in pred_spec were not found in data: bob

Created on 2024-10-08 with reprex v2.1.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions