Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ggadjustedcurves错误:Can';t使用矩阵或数组进行列索引_R_Cox Regression - Fatal编程技术网

ggadjustedcurves错误:Can';t使用矩阵或数组进行列索引

ggadjustedcurves错误:Can';t使用矩阵或数组进行列索引,r,cox-regression,R,Cox Regression,我得到这个信息: 错误:无法将矩阵或数组用于列索引 您的数据必须是TIBLE格式。尝试: ggadjustedcurves(拟合,变量=“研究”,数据=数据。框架(数据),方法=“平均”) fit <- coxph(Surv(time, status)~Age + strata(Study), data) ggadjustedcurves(fit, variable="Study", data=data, method="average")

我得到这个信息:

错误:无法将矩阵或数组用于列索引


您的数据必须是TIBLE格式。尝试: ggadjustedcurves(拟合,变量=“研究”,数据=数据。框架(数据),方法=“平均”)

fit <- coxph(Surv(time, status)~Age + strata(Study), data)
ggadjustedcurves(fit, variable="Study", data=data, method="average")