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 plot when infinite value warning in model #37

Open
sssimonyang opened this issue Dec 7, 2021 · 5 comments
Open

Error in plot when infinite value warning in model #37

sssimonyang opened this issue Dec 7, 2021 · 5 comments

Comments

@sssimonyang
Copy link

The package version is 0.6.2.
When I was plotting

> model = coxph(Surv(os, status) ~ group, total)
Warning message:
In coxph.fit(X, Y, istrat, offset, init, control, weights = weights,  :
  Loglik converged before variable  1,2 ; coefficient may be infinite. 
> print(forest_model(model))
Error in grDevices::axisTicks(log10(exp(forest_min_max)), TRUE) : 
  log - axis(), 'at' creation, _LARGE_ range: invalid {xy}axp or par; nint=5
	 axp[0:1]=(1e-307,1e+308), usr[0:1]=(0,inf); i=615, ni=123

It will run into error in plot when coefficient may be infinite warning is showed.
The result of model seems normal, only some value is too big.

> model
Call:
coxph(formula = Surv(os, status) ~ group, data = total)

              coef exp(coef)  se(coef)     z     p
groupIHR 1.943e+01 2.746e+08 2.993e+03 0.006 0.995
groupEHM 2.032e+01 6.712e+08 2.993e+03 0.007 0.995

Likelihood ratio test=96.25  on 2 df, p=< 2.2e-16
n= 224, number of events= 89 

I think it is acceptable to see inf value when the value is too big.

@gernophil
Copy link

Any updates on this?

@AbubakerSuliman
Copy link

AbubakerSuliman commented Jan 12, 2024

In my case, change the variable limits in forest_model to forest_model(..., limits = c(-1,1)) solves the issue

@bauer29
Copy link

bauer29 commented Jan 24, 2024

AbubakerSuliman, where did you added the command limits = c(-1,1) .
Here is the error in my code:

forest_model(coxph(Surv(Dias_sobrevida_enxerto, Enxerto_funcionante_1ano) ~ Germe_gravidade_tto + DM_sim_nao + Sexo_receptor + DGF , data = LPO), panels)
Warning in coxph.fit(X, Y, istrat, offset, init, control, weights = weights, :
Loglik converged before variable 2,3,5,6 ; coefficient may be infinite.
Error in eval_tidy(panels[[i]]$display, fd_for_eval) :
object 'n_events' not found

@AbubakerSuliman
Copy link

@bauer29 inside forest_model see ?forest_model for more details.
However, from the error message, you have a different issue. I would suggest posting a question in StackOverflow with reproducible data; share the link and I can have a look at it

@bauer29
Copy link

bauer29 commented Jan 24, 2024

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

4 participants