比较PLS回归模型的方法

时间:2019-02-20 19:45:22

标签: r linear-regression multivariate-testing manova pls

我想比较两个调整后的PLS回归模型。但是我没有找到任何办法。在我的人工示例中:

@Model.isUnsubscribable

输出错误:

#Packages
library(pls)
library(car)

#First simulate some data
set.seed(123)
bands=20
data <- data.frame(matrix(runif(60*bands),ncol=bands))
colnames(data) <- paste0(1:bands)
data$nitrogen <- rpois(60,10)
data$carbon <- rpois(60,10)
data$time <- c(rep(1,30),rep(2,30))
#

#define explanatory variables (x)

spectra1 <- as.matrix(data[1:30,1:20])
spectra2 <- as.matrix(data[31:60,1:20])

#Build PLS model 1
d1<-data[data$time==1,]
mod_pls1 <- plsr(carbon + nitrogen ~ spectra1,
ncomp = 20, data =d1, validation = "LOO", jackknife = TRUE)
#

#Build PLS model 2
d2<-data[data$time==2,]
mod_pls2 <- plsr(carbon + nitrogen ~ spectra2,
ncomp = 20, data =d2, validation = "LOO", jackknife = TRUE)
#

#Comparing PLS model 1 and 2
manova(mod_pls1,mod_pls2)
#

我想要的输出是一个p值,该值说明mod_pls1是否与mod_pls2类似。请,任何成员都可以帮助我为此找到统计解决方案? 谢谢!

0 个答案:

没有答案