R and Eviews: using xget
Posted: Fri Jul 23, 2010 8:46 am
using EViews 7.1
I would like to access R for a certain bootstrap procedure and I am using the new EViews to R interface. I have problems finding books on this topic or documents on the internet. In particular, I cannot figure out how to get a matrix from R back into EViews using the xget command. Although xget(name = var1, type = vector) works fine, a similar version using xget(name = var1, var2 , type = matrix) does not work. It appears that I have a syntax error in the names argument.
Here is an example code:
!n = 1000
xopen(type=r, case=lower)
xrun "library(meboot)"
xrun "if (sum(.packages(TRUE)==""meboot"")==0) install.packages(""meboot"")"
xrun var1 <- rnorm(!n,0,1)
xrun var2 <- rnorm(!n,0,2)
xrun vars2 <- cbind(rep(1:2,rep(!n,2)),c(var1, var2))
xrun z<- meboot.pdata.frame(na.omit(vars2), reps = 20, trim=0.1, reachbnd = FALSE, expand.sd = FALSE, force.clt = TRUE, elaps = FALSE, colsubj= 1, coldata = 2)
xget(name = test1, test2 , type = matrix) z[,1:2] 'this does not work
'xget(name = test1 , type = vector) z[,1] this works but I want a matrix (there are many columns so vector by vector extraction would be inefficient
xclose
any help is greatly appreciated
Zeno
I would like to access R for a certain bootstrap procedure and I am using the new EViews to R interface. I have problems finding books on this topic or documents on the internet. In particular, I cannot figure out how to get a matrix from R back into EViews using the xget command. Although xget(name = var1, type = vector) works fine, a similar version using xget(name = var1, var2 , type = matrix) does not work. It appears that I have a syntax error in the names argument.
Here is an example code:
!n = 1000
xopen(type=r, case=lower)
xrun "library(meboot)"
xrun "if (sum(.packages(TRUE)==""meboot"")==0) install.packages(""meboot"")"
xrun var1 <- rnorm(!n,0,1)
xrun var2 <- rnorm(!n,0,2)
xrun vars2 <- cbind(rep(1:2,rep(!n,2)),c(var1, var2))
xrun z<- meboot.pdata.frame(na.omit(vars2), reps = 20, trim=0.1, reachbnd = FALSE, expand.sd = FALSE, force.clt = TRUE, elaps = FALSE, colsubj= 1, coldata = 2)
xget(name = test1, test2 , type = matrix) z[,1:2] 'this does not work
'xget(name = test1 , type = vector) z[,1] this works but I want a matrix (there are many columns so vector by vector extraction would be inefficient
xclose
any help is greatly appreciated
Zeno