error message after running a "do" command in bootstrapping

asked 2014-04-11 05:56:12 +0000

Sirak gravatar image

updated 2014-04-11 06:02:44 +0000

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

edit retag flag offensive close merge delete

Comments

Please can you upload the cow.txt file so we can run this. It looks like the specification of COEF=beta:4 is incorrect. This would need to be COEF=beta

SHAZAMHelp gravatar imageSHAZAMHelp ( 2014-04-11 06:25:00 +0000 )edit

The errors are being caused by lines 5 and 6.

matrix qstar = x*starb
matrix e = q-qstar

Can you provide the rest of the script so that we can see where x*starb is calculated and figure out the solution for you?

SHAZAMHelp gravatar imageSHAZAMHelp ( 2014-04-11 14:39:44 +0000 )edit

This is the whole command. It went well upto the do command it is only after then the error appeared.

sample 1 556
genr one = 1
dim group 556 t 556 y 556 herd 556 feed 556 vet 556 price 556
read (sfa1.txt) group t y herd feed vet price / beg=1 end=238 list
read (sfa2.txt) group t y herd feed vet price / beg=239 end=378 list
read (sfa3.txt) group t y herd feed vet price / beg=379 end=556 list
sample 1 556
print group t y herd feed vet price
sample 1 556
matrix x = one|herd|feed|vet|price
print x
dim x1 238 5 x2 140 5 x3 178 5
copy x x1 / frows = 1;238 trows = 1;238
copy x x2 / frows = 239;378 trows = 1;140
copy x x3 / frows = 379;556 trows = 1;178
dim nomad 5 agrop ...
(more)
Sirak gravatar imageSirak ( 2014-04-14 02:57:25 +0000 )edit

how can I send you the whole command and text files. Thanks, Sirak

Sirak gravatar imageSirak ( 2014-04-14 03:01:15 +0000 )edit

Please email SHAZAM Help on the homepage. If you can include all the data files too would help.

SHAZAMHelp gravatar imageSHAZAMHelp ( 2014-04-14 14:28:25 +0000 )edit