`get_all_outcomes()`: 使用cuminc时出错

huangapple go评论74阅读模式
英文:

`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:

  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)
    

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)

huangapple
  • 本文由 发表于 2023年6月6日 07:39:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76410600.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定