提问人:joeke 提问时间:7/20/2023 最后编辑:IRTFMjoeke 更新时间:7/22/2023 访问量:40
获取“警告消息:1:在 rms::d atadist(data) 中:HAG_13是常量”
Getting "Warning messages: 1: In rms::datadist(data) : HAG_13 is constant"
问:
我正在尝试制作种群的生存样条图,但出现错误:
Warning messages:
1: In rms::datadist(data) : HAG_13 is constant
2: In rms::datadist(data) : HAG_13_21 is constant
3: In rms::datadist(data) : HAG_21 is constant
4: In rms::datadist(data) : AF_Flutter is constant
5: In rms::datadist(data) : HF is constant
6: In rms::datadist(data) : MI is constant
这是我的代码:
library(plotRCS)
plot_object <- rcsplot(
data = heart_data,
outcome = 'MORTALITY',
time = 'Echo_to_censure_date',
exposure = 'HAG',
covariates = 'Age',
positive = NULL,
group = NULL,
knots = c(0.25, 0.5, 0.75),
knots.line = FALSE,
ref.value = 0,
ref.line = T,
conf.int = T,
conf.level = 0.95,
conf.type = c("shape", "line"),
pvalue = F,
pvalue.digits = 3,
pvalue.position = c(1, 1),
pvalue.label.overall = "P for overall",
pvalue.label.nonlinear = "P for nonlinear",
fontsize = 10,
fontfamily = "serif",
linesize = 0.25,
linecolor = "#0072B5FF",
alpha = 0.1,
xbreaks = c(-5, 0, 5, 10, 15, 20, 25, 30, 35),
ybreaks = NULL,
xlab = "Heart Age Gap (years)",
ylab = "Mortality Hazard Ratio (95% CI)",
explain = TRUE,
xlim = c(-5, 30),
ylim = c(0, 8),
main = "Cardiovascular Mortality Hazard with increasing Heart Age Gap"
)
警告中命名的这些列确实只包含 0 或 1,但由于我没有调用它们,我认为这无关紧要。什么原因可能导致此错误,我该如何解决?
答: 暂无答案
评论