ShixiangWang / regport

Regression Model Processing Port
https://shixiangwang.github.io/regport/
Other
6 stars 2 forks source link

ideas #1

Open ShixiangWang opened 2 years ago

ShixiangWang commented 2 years ago

link to https://github.com/ShixiangWang/ezcox/issues/21

定义Model和Batcher两个对象

model分为数据,公式,focal term,covars,strates等

To be rethink

表格展示

R6

可视化

ShixiangWang commented 2 years ago

https://strengejacke.github.io/ggeffects/articles/introduction_marginal_effects.html

ShixiangWang commented 2 years ago

https://github.com/adayim/forestploter

ShixiangWang commented 2 years ago
> ggeffects::ggpredict(mm$model, "x")
Error in names(datlist) <- names(focal_terms) : 
  'names' attribute [1] must be the same length as the vector [0]
In addition: Warning message:
Could not get model data. 
> ggeffects::ggpredict(mm$model, terms = "x")
Error in names(datlist) <- names(focal_terms) : 
  'names' attribute [1] must be the same length as the vector [0]
In addition: Warning message:
Could not get model data. 

好像不兼容。模型本身的数据访问可能存在问题,这跟函数通过代码自动构建有关系

ShixiangWang commented 2 years ago

交互项可视化还不支持:

library(regport)
library(survival)

lung = survival::lung
lung$sex = factor(lung$sex)

model = REGModel$new(
  lung,
  recipe = Surv(time, status) ~ age * sex
)

model

model$get_forest_data()
model$plot_forest()
ShixiangWang commented 2 years ago