[R] problem in exceuting PLS

arunkumar1111 akpbond007 at gmail.com
Tue Oct 18 11:03:24 CEST 2011


Hi

I'm performing a PLS

This is my data present in a file

Year Y X2 X3 X4 X5 X6
1960 27.8 397.5 42.2 50.7 78.3 65.8
1960 29.9 413.3 38.1 52 79.2 66.9
1961 29.8 439.2 40.3 54 79.2 67.8
1961 30.8 459.7 39.5 55.3 79.2 69.6
1962 31.2 492.9 37.3 54.7 77.4 68.7

My R-code
Data <- read.csv("C:/TestData.csv")
variable=names(Data)[4:8]
dataset=NULL
dataset$X=NULL
len=length(variable)
for( i in 1:len)
{
  var=variable[i]
  if(i==1)
  {
    dataset$X=as.matrix(Data[var])
  }
  if(i>1)
  {
    dataset$X=as.matrix(cbind(dataset$X,Data[var]))
  }
  }
depVar="Y"
dataset$Y=as.matrix(cbind(Data[depVar]))
pls1=mvr(Y~X,data=dataset,ncomp=4)
summary(pls1)

On execution the error is

Error in get(as.character(FUN), mode = "function", envir = envir) :
  object 'X6' of mode 'function' was not found

Please help me on this


--
View this message in context: http://r.789695.n4.nabble.com/problem-in-exceuting-PLS-tp3914664p3914664.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list