Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.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
R:glmnet-cox错误_R_Glmnet_Cox Regression - Fatal编程技术网

R:glmnet-cox错误

R:glmnet-cox错误,r,glmnet,cox-regression,R,Glmnet,Cox Regression,我正在使用glmnet运行一个coxph模型。以下是我正在使用的代码: data <- read.csv("CSM Tiers by Org.csv", stringsAsFactors = FALSE, na.strings = "?") x <- model.matrix(~ data$CSM + data$Exclude + data$Queue) y <- data$Time status <- data$Event glmnet(x,Surv(y,status

我正在使用glmnet运行一个coxph模型。以下是我正在使用的代码:

data <- read.csv("CSM Tiers by Org.csv", stringsAsFactors = FALSE, na.strings = "?")
x <- model.matrix(~ data$CSM + data$Exclude +  data$Queue)
y <- data$Time
status <- data$Event
glmnet(x,Surv(y,status), family = "cox")
但我在数据中没有看到任何负面事件时间

> sum(y<0)
[1] 0

>求和(y检查是否求和(Y如果没有数据,将很难帮助您发生此错误。@MrFlick:我正在尝试上载数据…但它的文件太大。我们不需要您的精确输入文件。请参阅我提供的链接中的技巧,以创建具有代表性的输入数据集。它只需足以触发与您得到的完全相同的错误即可。谢谢@Branden Murray!我发现数据集确实有一些0。当0被删除时,模型运行
> sum(y<0)
[1] 0