Hi there,

I've got an Access 2007 database and my first tries to establish a
connection were disappointing, failing in the
'open' stage : Error in SQLConnect [Microsoft][ODBC Driver Manager].
I'm new to that stuff and have no idea how to fix the problem. Both the
database and GRETL are in on my Windows 7 PC.
I would appreciate your help!!!

Best
Pindar


-----Ursprüngliche Nachricht-----
Von: gretl-users-bounces(a)lists.wfu.edu
[mailto:gretl-users-bounces(a)lists.wfu.edu] Im Auftrag von Riccardo (Jack)
Lucchetti
Gesendet: Samstag, 3. April 2010 10:33
An: Gretl list
Cc: Fernando Borraz
Betreff: Re: [Gretl-users] Manipulating a database

On Sat, 3 Apr 2010, Leandro Zipitria wrote:

> Hello Gretl Community,
> 
> I have a database with daily prices which is in a rather unusual 
> format and I want to know if it is possibly to create a panel data with it
using Gretl scripts. The database is extracted from a dbf archive, and its
has 6 variables:
> 
> - The (number of) supermarket from which the price is reported
> - The (number of) the product which price is being reported
> - The year of the price
> - The month of the price
> - The price reported itself
> - The first day of the month the price is reported
> - The last day of the month the price is reported
> 
> I have nearly one million rows with data, but in order to do some
regressions -and use it as a panel- I will need to transform it in a
suitable way.
> 
> I suppose that the best way that Gretl can handle it is to create a 
> specific column for each product, and then stack all the supermarkets 
> on a daily basis. In this way, I will have each column representing a
product, the first 700 rows being a price for each product for supermarket
1, the next 700 rows being a price for each product for supermarket 2, etc.
> But in order to do it, I will need first to create the daily prices 
> series, which is now "compacted" in the datafile. I am attaching a random
10 elements from the database in order to get a better picture of the
situation. In the first sheet I submit the actual data format, on the second
one which I think should be the (best?) result.
> 
> I will first ask if this kind of transformation is possible in Gretl. 
> I am aware that running some scripts on other programs could do the trick,
but I think that it could be possible in Gretl to do it. But I am also think
that it could be rather complex to do it, and I am a new one on this issues.

Two remarks/suggestions:

1) Turning a dataset such as this into a panel dataset is not trivial from a
_conceptual_ point of view: what are your units? supermarkets or products?
or combinations of the two? What would you use as the time unit (day, month,
week)? If you choose anything longer than a day (say, a week), how would you
handle changes of prices during the week? Of course, this is a design
decision and gretl can't help you with this.

2) If you have your data in some database that can be queried via SQL, I
think that our ODBC apparatus may just fit your needs. You may want to have
a look at the corresponding chapter of the User's Guide.


Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche

r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti


Reply via email to