On Mon, 6 Jun 2011, Leandro Zipitria wrote:

> If I am working with a restricted version of a variable (using smpl 
> --restrict), the mean, standard deviation, etc. reported is for the 
> variable as a whole or just the restricted sample?

Just the restricted sample. Example:

gretl version 1.9.5cvs
Copyright Ramu Ramanathan, Allin Cottrell and Riccardo "Jack" Lucchetti
This is free software with ABSOLUTELY NO WARRANTY
Current session: 2011-06-06 21:11

"help" gives a list of commands
Type "open filename" to open a data set
? open data4-1
  open data4-1

Read datafile /usr/local/share/gretl/data/data4-1.gdt
periodicity: 1, maxobs: 14
observations range: 1-14

Listing 5 variables:
   0) const     1) price     2) sqft      3) bedrms    4) baths

? m  = mean(sqft)
  m = mean(sqft)
Generated scalar m = 1910.93
? smpl 2 10
  smpl 2 10
Full data range: 1 - 14 (n = 14)
Current sample: 2 - 10 (n = 9)

? m  = mean(sqft)
  m = mean(sqft)
Replaced scalar m = 1670.44

> As a second answer, I am creating a doble loop for iterating mean and 
> standar deviation from a variable. I want to create a matix that store 
> the results of each calculation. That is, I have a panel, and want to 
> restrict it looping on one variable (city) which will be the columns, 
> and the time the rows. Each time gretl compute one statistic, I am 
> trying to store it in the matrix, following the previous order. Is this 
> possible?

Yes it is. That said, I'm not at all sure to have understood what your 
need is, but I have the feeling that you can write a much more efficient 
script by using the pmean() and psd() function. Also, the user's guide is 
your friend.

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