SHAZAM Questions and Answers (Q&A) - RSS feedhttp://community.econometrics.com/questions/SHAZAM Econometrics, Statistics and Analytics Communityen<font color="white">Copyright <b>SHAZAM Analytics, 2018</b></font>Fri, 11 Mar 2016 15:54:55 +0000How to use a DO loop to generate a sample of an AR serieshttp://community.econometrics.com/question/707/how-to-use-a-do-loop-to-generate-a-sample-of-an-ar-series/ Hi all,
I tried to do some programming in Shazam, but I unfortunately I am stranded. I have the following problem that I’m struggling with: My objective is to generate a selected number of AR(1)-series by using the do-loop command on the following script (which only generates a single series):
SAMPLE 1 5
GENR YEAR = TIME(0)
GENR X2 = NOR(3)
GENR y = 1
GENR y = 1 + 0.2*LAG(Y) + X2
PRINT y year
Further – the problem is to store the n-AR(1) series in a n-column matrix and then be able to graph the series in a single figure and as well (optionally) separately (with the generated YEAR-variable on the x-axis). Great if I could get some help with the right SHAZAM -script which could sort this out :-)
Kind regards,
TL
TLFri, 11 Mar 2016 15:54:55 +0000http://community.econometrics.com/question/707/error message after running a "do" command in bootstrappinghttp://community.econometrics.com/question/486/error-message-after-running-a-do-command-in-bootstrapping/Hi all,
I have got some problem when computing standard deviations for metafrontier parameters, which I have estimated previously, through bootstrapping.
The error message starts after the do command and it says syntax error when generating variable. I appreciate your help. See the error message and the command that I have used below. Note that x*starb are previously estimated.
|_sample 1 556
|_matrix q = cowva
|_matrix qstar = x*starb
|_matrix e = q-qstar
|_dim beta 5 1000
|_set nodoecho
|_set nooutput
|_set ranfix
|_do #=1, 1000
|_gen newe = samp(e)*SQRT(N/(N-K))
|_sample 1 556
|_stat newe
|_gen qnew = qstar+newe
|_OLS qnew feed vet herd price / COEF=beta:4
|_endo
$
...ERROR..SYNTAX ERROR WHEN GENERATING VARIABLE
|_matrix bstre = newe'
$
...ERROR..SYNTAX ERROR WHEN GENERATING VARIABLE
|_matrix beta = beta'
|_set output
|_sample 1 1000
|_stat bstre
...ERROR..VARIABLE bstre DOES NOT EXIST.
|_sample 1 1000
|_stat beta
|_stop
The command I have used is :
dim cowva 556
read (cow.txt) cowva / beg=1 end=556 list
sample 1 556
matrix q = cowva
matrix qstar = x*starb
matrix e = q-qstar
dim beta 5 1000
set nodoecho
set nooutput
set ranfix
do #=1, 1000
gen newe = samp(e)*SQRT(N/(N-K))
sample 1 556
stat newe
gen qnew = qstar+newe
OLS qnew feed vet herd price / COEF=beta:4
endo
matrix bstre = newe'
matrix beta = beta'
set output
sample 1 1000
stat bstre
sample 1 1000
stat beta
stop
Thanks,
Sirak
SirakFri, 11 Apr 2014 05:56:12 +0000http://community.econometrics.com/question/486/