I am trying to generate panel data.
So, I first made the panel and time variables as below.
Here, I want to generate normally distributed time-invariant covariates.
Specifically, what I want to generate is
However, I am not sure how to do that in Stata.
(I am trying to do not use loop or reshape or Mata)
So, I first made the panel and time variables as below.
Code:
local N = 1000 // # units local T = 3 // # periods local NT = `N' * `T' set obs `NT' egen pid = seq(), block(`T') egen tid = seq(), to(`T')
Specifically, what I want to generate is
Code:
mata: N = 1000 T = 3 rnormal(N, 2, 0, 1) # J(T, 1, 1) end
(I am trying to do not use loop or reshape or Mata)
Comment