Hello,
I'm importing data from an excel file into a panel using the following
script:
open simulation.xls --sheet=1 --rowoffset=2 --preserve
# grab the transpose of the data as a matrix
M = {dataset}'
# and record the length of the time dimension
scalar T = rows(M)
open simulation.xls --sheet=2 --rowoffset=2 --preserve
# stick on row-wise the transpose of the next data
M |= {dataset}'
open simulation.xls --sheet=3 --rowoffset=2 --preserve
# stick on some more data
M |= {dataset}'
scalar NT = rows(M)
# create a suitably sized dataset
nulldata NT --preserve
# pull out the columns of M as series
series v1 = M[,1]
series v2 = M[,2]
delete index
# hello gretl, this is a panel!
setobs T 1.1 --stacked-time-series
series year = time + 2004
# take a look
print --byobs
####################3
The problem is that the panel is backwards , I tried the solution from the
manual by I can't get it right.
Any suggestions?
Thanks,Mihai
ps: I know that I could flip the dataset in excel but because I have about
70 sheets and over 100 variables this is not practical at all.