[R] How to simulate a variable Xt=Wit+0.5Wit-1 with

2011-01-25 Thread Millo Giovanni
R. Other than this, it's just basic R, trying it out and seeing if it works. Best wishes, Giovanni --- original message --- Message: 18 Date: Mon, 24 Jan 2011 14:38:43 + From: car...@sapo.pt To: r-help Subject: [R] How to simulate a variable Xt=Wit+0.5Wi

[R] How to simulate a variable Xt=Wit+0.5Wit-1 with Wit~U(0,2)

2011-01-24 Thread carpan
Dear all I simulate a panel data: n <- 10 t <- 5 nt <- n*t pData <- data.frame(id = rep(paste("JohnDoe", 1:n, sep = "."), each = t),time = rep(1981:1985, n)) rho <-0.99#simulate alphai corelated with the xi print(rho) alphai <- rnorm(n,mean=0,sd=1)#alphai simulation x<- as.matrix(rnorm(n