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

Compatibility with 'with()' generic #35

Open
ellessenne opened this issue Oct 25, 2024 · 0 comments
Open

Compatibility with 'with()' generic #35

ellessenne opened this issue Oct 25, 2024 · 0 comments

Comments

@ellessenne
Copy link

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

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

1 participant