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

Forestmodel no longer showing interaction terms in multivariable model #35

Open
radiaj opened this issue Oct 26, 2021 · 1 comment
Open

Comments

@radiaj
Copy link

radiaj commented Oct 26, 2021

Hello, I have generated some figures in the past that showed the interaction terms in the figure and now they have been removed with only main terms being showing in the plot. How do I switch it back to generate these plots.

library(forestmodel)
library(survival)
library(dplyr)
pretty_lung <- lung %>%
    dplyr::transmute(time,
              status,
              Age = age,
              Sex = factor(sex, labels = c("Male", "Female")),
              ECOG = factor(lung$ph.ecog),
              `Meal Cal` = meal.cal)

print(forest_model(coxph(Surv(time, status) ~ ECOG * Age, pretty_lung)))

coxph(Surv(time, status) ~ ECOG * Age, pretty_lung
+ )
Call:
coxph(formula = Surv(time, status) ~ ECOG * Age, data = pretty_lung)

               coef exp(coef)  se(coef)      z       p
ECOG1       3.94301  51.57385   1.62842  2.421 0.01546
ECOG2       5.29316 198.97030   1.89672  2.791 0.00526
ECOG3       1.76105   5.81852   1.03344  1.704 0.08837
Age         0.05991   1.06174   0.02222  2.696 0.00702
ECOG1:Age  -0.05718   0.94442   0.02540 -2.251 0.02439
ECOG2:Age  -0.06954   0.93283   0.02907 -2.392 0.01677
ECOG3:Age        NA        NA   0.00000     NA      NA

Likelihood ratio test=26.49  on 6 df, p=0.0001804
n= 227, number of events= 164 
   (1 observation deleted due to missingness)

But the output figure only shows

ECOG1 3.94301 51.57385 1.62842 2.421 0.01546
ECOG2 5.29316 198.97030 1.89672 2.791 0.00526
ECOG3 1.76105 5.81852 1.03344 1.704 0.08837
Age 0.05991 1.06174 0.02222 2.696 0.00702

Rplot

@ypnngaa-py
Copy link

I have the same question. Wondering if interaction term is supported

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

2 participants