From cottrell@wfu.edu Fri Feb 4 12:36:24 2011 From: Allin Cottrell To: gretl-users@gretlml.univpm.it Subject: Re: [Gretl-users] import data via odbc Date: Fri, 04 Feb 2011 12:36:23 -0500 Message-ID: In-Reply-To: 3233_1296736782_p13Cdfnv006831_4D4AA165.5060000@zedat.fu-berlin.de MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8569038316953915976==" --===============8569038316953915976== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, 3 Feb 2011, Leon Unger wrote: > Am 31.01.2011 21:43, schrieb Allin Cottrell: > > string Q = "SELECT country,year,y FROM FooBase" > > data y obs-format="%s:%d" query=Q --odbc > > > > This should work if the "country" variable contains string > > country-codes such as "FRA", "GER", etc., and the year variable > > contains years as integers: > > > > GER:1990 123.5 > > GER:1991 127.6 > > > > This assumes that the pre-existing gretl dataset has observation > > strings on the pattern shown above. > > I created an empty panel dataset with appropriate obs:time > combinations and then used the GUI to read in the oberservation > markers from a txt file. I know how to create the 'normal' empty > panel via script, but how can I get the markers directly from > script? Well, you could do something like this: That will give you a file containing the observation markers. You can add these to a dataset using the GUI ( /Data/Observation markers ), or, if you use the latest snapshot from http://gretl.sourceforge.net/win32/ , you can add the markers via script using a new option to "setobs", as in Allin Cottrell --===============8569038316953915976==--