Hi artur,

 

thanks for the code, it works really fine.

In a first step I updated it in order to print only the ith value, but

really great would be to specify a random order like 1 20 and 25.

 

Here is the code

 

#print out the tth value of the ith unit

scalar t = 7 # this is the t-th period to display through all units

scalar ids = 25 # this is the i-th unit

loop for (n=(t+T*(ids-1)); n<=ids*T; n+=T) --quiet

    loop for (i=ids;i<=ids;i+=1) --quiet

        nothing_$i = nothing[n]

        print nothing_$i

    endloop

endloop

 

Cheers

Pindar

Von: gretl-users-bounces@lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] Im Auftrag von artur bala
Gesendet: Mittwoch, 26. Mai 2010 18:12
An: Gretl list
Betreff: Re: [Gretl-users] Another loop question and a print question

 

Hi pindar,

Hope the following script may (partially) help you. It prints out the t-th period  value for each unit.

 

<script>

# a panel of 25 units x 7 periods

genr series nothing = normal(0,1)

scalar scl = 0

scalar n = 3 # this is the t-th period to display through all units

loop for (n=3; n<=175; n+=7) --quiet

     scl = nothing[n]

     print scl

endloop

<\script>

artur

> Message du 26/05/10 12:14
> De : "Pindar"
> A : "'Gretl list'"
> Copie à :
> Objet : [Gretl-users] Another loop question and a print question
>
>

Hi there,

 

I have a panel data set and want to print the realization of a variable for the ith individual at the

the tth period without altering the sample via smpl. If this works it should be possible to do

such operations not only for one individual and period but in a loop for several individuals and periods.

Unfortunately up until now I didn’t find the way to do it.

 

Thanks for your help

Pindar

 

 

>
> [ (pas de nom de fichier) (0.1 Ko) ]



Pieddemail