Please post this sort of question to the gretl-users mailing list
[
http://lists.wfu.edu/mailman/listinfo/gretl-users ]
I'm forwarding it to the list; my comments follow the question.
On Fri, 13 Mar 2015, Christian Mücher wrote:
I am an economics student at the university of constance. During the
last semester I leaned the use of the econometrics program gretl.
Right now I am writing my Bachelor Thesis with this program and
encountered a problem.
I am using the Children of the Immigrants Longitudinal Study Dataset
http://doi.org/10.3886/ICPSR20520.v2
When importing the Dataset in gretl the panel structure of the
dataset is lost. When trying to impose a panel structure on the
dataset the problem ist, that there is no variable measuring the
period. Further, the Dataset is coded such that each observation is
in one row and all variables are in columns. The problem is, that v1
to v148 are measured in period 1, v203 to p144 are measured in
period 2 and v400 to v450 are measured in period 3. But I fail to
define this periodicity such that a panel structure can be defined.
I tried pretty much everything I could think of, and my supervising
professor does not now gretl. The tutor who taught us gretl also has
no solution for my problem. The last thing I can think of ist to
export the Dataset as .csv file and include a timevariable manually.
I hope that you can help me out with an easier way, as this method
would be very time consuming.
From what I can tell, the ICPSR20520 dataset is not actually a panel,
although it is longitudinal. According to the codebook, the three
waves differ in regard to the information recorded, although there is
some overlap between the waves. You'll have to think carefully about
how you want to analyse these data.
That said, if you need to rearrange blocks of data to get a semblance
of a panel, then gretl's matrix methods are likely to be useful. Just
to illustrate, here's a hansl script to make a matrix out of variables
v1 to v148:
<hansl>
set echo off
set csv_delim tab
open 20520-0001-Data.tsv
list L1 = v1..v148
matrix X1 = {L1}
</hansl>
Having created blocks of this sort you can then create a new dataset
of an appropriate size and extract series from the blocks in the
"right places", wherever that may be:
<hansl>
scalar N = <you figure it out>
nulldata N --preserve
# pull stuff from matrices into series
# use "smpl" to set the range for writing from matrix to series
</hansl>
Allin Cottrell