【发布时间】:2019-08-24 14:10:44
【问题描述】:
我使用多个预测变量进行了总最小二乘回归,但我的代码没有产生任何 p 值等。就我的论文而言,我需要评估系数的重要性,以期自举获得百分位置信区间,但我不知道如何从这里开始。
我尝试了命令 boot(data, statistic, R),但我不确定要为数据输入什么。我拥有的功能是在 pracma 中使用 odregress 命令进行回归。我只是将我的 DV 向量和一个矩阵与我的命令的 IV 值隔离开来。
X <- data.matrix(avgsubset1) # matrix of all preditors (IV)
Y <- as.vector(v$avgdatadelay.beh1) #vector of DV
TLS <- odregress(X,Y); TLS
getRegr <- function(X, Y) {
bsFit <- odregress(X,Y)
as.numeric(coef(bsFit))
}
nR <- 1000
(bsRegr <- boot(data = ???, statistic=getRegr, R=nR))
boot.ci(bsRegr, conf=0.95, type="bca")$bca
【问题讨论】:
-
不要分离数据。 full 数据框是
boot需要的。 -
是这两个问题(p 值和引导)吗?
标签: r regression statistics-bootstrap