jinseob2kim / jstable

Regression Tables from 'GLM', 'GEE', 'GLMM', 'Cox' and 'survey' Results.
https://jinseob2kim.github.io/jstable/
Apache License 2.0
20 stars 12 forks source link

about TableSubgroupMultiGLM #35

Open Licun1 opened 2 months ago

Licun1 commented 2 months ago

TableSubgroupMultiCox(Surv(time, status) ~ sex, var_subgroups = c("kk", "kk1"), data = lung, line = TRUE) Variable Count Percent Point Estimate Lower Upper sex=1 sex=2 P value P for interaction sex Overall 228 100 1.91 1.14 3.2 100 100 0.014 1 2 kk 0.525 3 0 38 16.9 2.88 0.31 26.49 10 100 0.35 4 1 187 83.1 1.84 1.08 3.14 100 100 0.026 5 6 kk1 0.997 7 0 8 3.6 0 100 8 1 217 96.4 1.88 1.12 3.17 100 100 0.018 警告信息: In coxph.fit(X, Y, istrat, offset, init, control, weights = weights, : Loglik converged before variable 1,2,3 ; coefficient may be infinite. TableSubgroupMultiGLM(status ~ sex, var_subgroups = c("kk", "kk1"), data = lung, family = "binomial") [1] "binomial"

Thank you very much for providing this package. However, when I use the TableSubgroupMultiGLM function, it seems that the returned values are incorrect. But when I use the TableSubgroupMultiCox function, it returns the correct values. What's wrong with it?

jinseob2kim commented 1 month ago

I run TableSubgroupMultiGLM(status ~ sex, var_subgroups = c("kk", "kk1"), data = lung, family = “binomial”). The below is the result.

Could you show what that wrong result is ?

     Variable Count Percent           OR Lower Upper P value P for interaction
sex2  Overall   228     100         3.01  1.65  5.47  <0.001              <NA>
1          kk  <NA>    <NA>         <NA>  <NA>  <NA>      NA             0.476
2           0    38    16.9            7   0.7 70.03   0.098              <NA>
3           1   187    83.1         2.94  1.55  5.57   0.001              <NA>
4         kk1  <NA>    <NA>         <NA>  <NA>  <NA>      NA             0.984
5           0     8     3.6 314366015.19     0   Inf   0.997              <NA>
6           1   217    96.4         2.85  1.55  5.25   0.001              <NA>