
n <- 500
eps <- 0.05
g <- rep(1, n)
xi1 <- rnorm(n)
eta1 <- 0.8*xi1 + rnorm(n, 0, eps)
eta2 <- 0.8*xi1 + 0.3*eta1 + rnorm(n, 0, eps)
xi11 <- round(xi1 + rnorm(n, 0, eps))
xi12 <- round(0.9*xi1 + rnorm(n, 0, eps))
xi13 <- round(1.1*xi1 + rnorm(n, 0, eps))
eta11 <- round(eta1 + rnorm(n, 0, eps))
eta12 <- round(0.9*eta1 + rnorm(n, 0, eps))
eta13 <- round(1.1*eta1 + rnorm(n, 0, eps))
eta21 <- round(eta2 + rnorm(n, 0, eps))
eta22 <- round(0.9*eta2 + rnorm(n, 0, eps))
eta23 <- round(1.1*eta2 + rnorm(n, 0, eps))
data <- cbind(g, xi11, xi12, xi13, eta11, eta12, eta13, eta21, eta22, eta23)

n <- 500
eps <- 0.05
g <- rep(2, n)
xi1 <- rnorm(n)
eta1 <- 0.8*xi1 + rnorm(n, 0, eps)
eta2 <- 0.8*xi1 + 0.3*eta1 + rnorm(n, 0, eps)
xi11 <- round(xi1 + rnorm(n, 0, eps))
xi12 <- round(0.9*xi1 + rnorm(n, 0, eps))
xi13 <- round(1.1*xi1 + rnorm(n, 0, eps))
eta11 <- round(eta1 + rnorm(n, 0, eps))
eta12 <- round(0.9*eta1 + rnorm(n, 0, eps))
eta13 <- round(1.1*eta1 + rnorm(n, 0, eps))
eta21 <- round(eta2 + rnorm(n, 0, eps))
eta22 <- round(0.9*eta2 + rnorm(n, 0, eps))
eta23 <- round(1.1*eta2 + rnorm(n, 0, eps))

data <- rbind(data, cbind(g, xi11, xi12, xi13, eta11, eta12, eta13, eta21, eta22, eta23))

colnames(data) <- c('Group', 'xi11', 'xi12', 'xi13', 'eta11', 'eta12', 'eta13', 'eta21', 'eta22', 'eta23')
data <- as.data.frame(data)

write.csv(data, file="dataset25.csv", row.names=FALSE)

