Hello Mihai
If I got your problem I would try the following to flip the series
scalar count=0
scalar n_obs = $nobs
loop foreach i v1..v2
series tmp = $i
loop for j=1..n_obs
v[j]=tmp[n_obs-count]
count = count +1
endloop
endloop
Hope it helps
Best,
Artur
2014-03-10 12:20 GMT+01:00 cociuba mihai <cociuba(a)gmail.com>:
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.
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users