英文:
`get_all_outcomes()`: error when using cuminc
问题
我正在尝试在医学数据库中进行竞争风险分析。
安装所需的包后,我运行以下代码:
cuminc(Surv(HAPLO$SEGUIMIENTO, HAPLO$SEGFINAL) ~ 1, data = HAPLO)
但我一直收到以下错误:
Error in `get_all_outcomes()`:
! The following outcomes were not found in `data`: 'HAPLO'.
Run `rlang::last_trace()` to see where the error occurred.
如果我运行 rlang::last_trace()
我得到:
Backtrace:
▆
1. ├─tidycmprsk::cuminc(...)
2. └─tidycmprsk:::cuminc.formula(...)
3. ├─hardhat::mold(formula, data, blueprint = hardhat::default_formula_blueprint(intercept = TRUE))
4. └─hardhat:::mold.formula(formula, data, blueprint = hardhat::default_formula_blueprint(intercept = TRUE))
5. ├─hardhat::run_mold(blueprint, data = data)
6. └─hardhat:::run_mold.default_formula_blueprint(blueprint, data = data)
7. └─hardhat:::mold_formula_default_process(...)
8. └─hardhat:::mold_formula_default_process_outcomes(...)
9. └─hardhat:::get_all_outcomes(formula, data)
我不知道该怎么办。
提前感谢。
RAFA
英文:
I am trying to do a competing risk analysis in a medical database.
After installing packages I read were needed I run the following code:
cuminc(Surv(HAPLO$SEGUIMIENTO, HAPLO$SEGFINAL) ~ 1, data = HAPLO
And I keep getting this error
Error in get_all_outcomes()
:
! The following outcomes were not found in data
: 'HAPLO'.
Run rlang::last_trace()
to see where the error occurred.
If i run rlang::last_trace()
I get
Backtrace:
▆
- ├─tidycmprsk::cuminc(...)
- └─tidycmprsk:::cuminc.formula(...)
- ├─hardhat::mold(formula, data, blueprint = hardhat::default_formula_blueprint(intercept = TRUE))
- └─hardhat:::mold.formula(formula, data, blueprint = hardhat::default_formula_blueprint(intercept = TRUE))
-
├─hardhat::run_mold(blueprint, data = data)
-
└─hardhat:::run_mold.default_formula_blueprint(blueprint, data = data)
-
└─hardhat:::mold_formula_default_process(...)
-
└─hardhat:::mold_formula_default_process_outcomes(...)
-
└─hardhat:::get_all_outcomes(formula, data)
I dont know what to do.
Thanks in advance.
RAFA
答案1
得分: 1
Using the formula interface to a function, you supply just the column names, for example, SEGUIMIENTO
, rather than HAPLO$SEGUIMIENTO
.
So for data frame HAPLO
, this should work:
library(tidycmprsk)
cuminc(Surv(SEGUIMIENTO, SEGFINAL) ~ 1, data = HAPLO)
英文:
Using the formula interface to a function, you supply just the column names e.g. SEGUIMIENTO
, rather than HAPLO$SEGUIMIENTO
.
So for data frame HAPLO
this should work:
library(tidycmprsk)
cuminc(Surv(SEGUIMIENTO, SEGFINAL) ~ 1, data = HAPLO)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论