Dear Statalisters,
My data is a panel : timeid is yrqtr which is generated from year and quarter for each observation , I attached a small sample data.
I was able to run the following code which contains mata (see block 1), it works if I run it for each quarter individually,
However, when I put a forval loop at the very beginning, mata does not seem to like it. it breaks : --Break--
r(1);
I kind of got around it by creating two do files, put the block that contains mata in a standalone do file (see attached file named "mataitself"). and call this do file from another do file. the program runs, but in the log it has red ink output saying "expression invalid makesym() already exists", but the output data seems fine.
Question:
1. if you can add a forval loop cycle through all quarters (my panel qyrqtr ranges from 81 to 206 , calendar year 1981 to 2012 ) , my sample only shows 2 quarters. and save my output from getmata
2. using two do files - using one to call the mataitself,should I be concerned with "expression invalid makesym() already exists" in the log?
Thank you,
Rochelle
My data is a panel : timeid is yrqtr which is generated from year and quarter for each observation , I attached a small sample data.
I was able to run the following code which contains mata (see block 1), it works if I run it for each quarter individually,
However, when I put a forval loop at the very beginning, mata does not seem to like it. it breaks : --Break--
r(1);
I kind of got around it by creating two do files, put the block that contains mata in a standalone do file (see attached file named "mataitself"). and call this do file from another do file. the program runs, but in the log it has red ink output saying "expression invalid makesym() already exists", but the output data seems fine.
Question:
1. if you can add a forval loop cycle through all quarters (my panel qyrqtr ranges from 81 to 206 , calendar year 1981 to 2012 ) , my sample only shows 2 quarters. and save my output from getmata
2. using two do files - using one to call the mataitself,should I be concerned with "expression invalid makesym() already exists" in the log?
Thank you,
Rochelle
Comment