# Set the sample size and save it in n nulldata 100 scalar n = $nobs # generate n observations on x series x = uniform() set seed 3213799 # set a seed if you want to get same results # Set the values of the parameters scalar slope = 10 scalar sigma = 20 scalar delta = .7 scalar rho = .9 # initialize variables u and y series u = normal() series y = normal() # start the loop, indicating the desired number of samples. loop 400 --progressive --quiet # generate normal errors series e = normal(0,sigma) # generate autocorrelated errors series u=rho*u(-1)+e # generate sample of y series y = slope*x + delta*y(-1) + u # run the LDV regression ols y const x y(-1) # run the non-LDV regression ols y const x # run co ar 1; y const x y(-1) # run ardl21 ols y const x y(-1) x(-1) y(-2) endloop