【发布时间】:2014-10-08 15:13:35
【问题描述】:
谁能告诉我是否可以合并:
a) 交互项
b) 随机效应
在 R 的 Tobit 回归模型中?
对于交互术语,我一直在编写以下脚本,但这不起作用。
fit <- vglm(GAG_p_DNA~factor(condition)+factor(time)+factor(condition):factor(time),
tobit(Lower = 0))
Error in if ((temp <- sum(wz[, 1:M, drop = FALSE] < wzepsilon))) warning(paste(temp, :
argument is not interpretable as logical
我也尝试过使用虚拟变量,通过以下方式创建:
time.ch<- C(time, helmert,2)
print(attributes(time.ch))
condition.ch<-C(condition, helmert, 3)
print(attributes(condition.ch))
但我得到同样的错误。
数据集的一部分(GAG_p_DNA 值为零被删减)(警告:可能复制此内容的人。OP 使用制表符作为分隔符。)
Donor Time Condition GAG_p_DNA cens_GAG_p_DNA
1 1 6 0.97 1
1 1 10 0.93 1
1 7 2 16.65 1
1 7 6 0.94 1
1 7 10 1.86 1
1 28 2 21.66 1
1 28 6 0.07 1
1 28 10 3.48 1
2 1 1 1.16 1
2 1 2 2.25 1
2 1 6 2.41 1
2 1 10 1.88 1
2 7 2 13.19 1
2 7 10 2.54 1
2 28 2 23.93 1
2 28 6 0 0
2 28 10 15.17 1
我很可能需要使用 Tobit 回归模型,因为 R 似乎不支持带有左删失数据的 Cox 模型...
fit<- survfit(Surv(GAG_p_DNA, cens_GAG_p_DNA, type="left")~factor(condition)+factor(Time))] [Error in coxph(Surv(GAG_p_DNA, cens_GAG_p_DNA, type = "left") ~ factor(condition) + : Cox model doesn't support "left" survival data
【问题讨论】:
-
我会写成这样:
GAG_p_DNA~factor(condition)*factor(time) -
同名包中的
coxme函数实现了删失数据的混合效应估计。如果您提供数据(可能是模拟的),则可能会编写一些代码。 -
另外,我需要使用 Tobit 回归模型,因为我留下了 cenosred 数据。不幸的是,使用左删失无法在 R 中执行 cox 模型。
-
关于在 R 中不可能进行左审查的说法是错误的。请阅读 pkg:survivaL 中的 ?Surv 页面 请编辑您的问题以包含生成示例的代码,而不是在 cmets 中发布格式不正确的数据。 (以上材料中没有审查变量。)
-
仍然没有数据。无法提供进一步的建议。
标签: r regression