# NOT RUN {
set.seed(1)
t <- 10; n = 5; p = 20; size.groups = 4
index <- ceiling(1:p / size.groups)
X <- matrix(rnorm(n * t * p), ncol = p, nrow = n*t)
beta <- c(5,4,3,2,1)
y <- X[,1:5] %*% beta + 5*rnorm(n*t)
Z <- kronecker(diag(n), rep(1, times = t))
entity_indices <- sort(rep(1:n,times=t-1))
fit <- panel_sgl(X = X, Z = Z, y = y, index = index,
entity_indices = entity_indices, gamma_w = 1,
regress_choice = "fe", method_choice = "ic",
num_cores = 2, verbose = FALSE)
predict.panel_sgl(object = fit, newX = X, newZ = Z, regress_choice = "fe")$pred
# }
Run the code above in your browser using DataLab