Skip to content

Compatibility with 'with()' generic #35

@ellessenne

Description

@ellessenne

Hi Mark,

I hope all is well!

Just a quick question / bug report: I think the default fitting function stpm2 does not play nicely with the with() function:

library(rstpm2)
#> Loading required package: survival
#> Loading required package: splines
#> 
#> Attaching package: 'rstpm2'
#> The following object is masked from 'package:survival':
#> 
#>     colon
data("brcancer")
with(brcancer, stpm2(Surv(rectime, censrec == 1) ~ hormon + x1 + x2 + x3 + x4 + x5 + x6 + x7, df = 3))
#> Error in stpm2(Surv(rectime, censrec == 1) ~ hormon + x1 + x2 + x3 + x4 + : argument "data" is missing, with no default

What I was expecting was for something like this to work:

with(brcancer, glm(censrec == 1 ~ hormon, family = binomial()))
#> 
#> Call:  glm(formula = censrec == 1 ~ hormon, family = binomial())
#> 
#> Coefficients:
#> (Intercept)       hormon  
#>     -0.1366      -0.3440  
#> 
#> Degrees of Freedom: 685 Total (i.e. Null);  684 Residual
#> Null Deviance:       939.7 
#> Residual Deviance: 935.1     AIC: 939.1

Any ideas?

Thanks,

Alessandro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions