On Fri, 31 May 2019, Riccardo (Jack) Lucchetti wrote:
On Fri, 31 May 2019, Fred Engst wrote:
> #5: The sorting issue is only true in the famous mroz dataset that is used
> by both Wooldridge’s “Introductory Econometrics A Modern Approach" textbook
> and HIll-Grifit-Lim’s “Principles of Econometrics" textbook.
>
> However, I’ve just confirmed, only the one “mroz.gdt" downloaded from
> Wooldridge’s datalink
>
https://sourceforge.net/projects/gretl/files/datafiles/wooldridge.tar.gz/...
>
<
https://sourceforge.net/projects/gretl/files/datafiles/wooldridge.tar.gz/...
> seems to have this problem, sorting by wage or lwage have the same results.
> The one downloaded from POE’s don’t.
Uhm, funny. I can't reproduce this. This is what I just tried (after
downloading the dataset form sourceforge and storing the gdt file into a
temporary dir):
<hansl>
set verbose off
open /tmp/mroz.gdt --quiet
series orig_order = time
scalar check = ( min(diff(wage)) >= 0 ) && ( min(diff(lwage)) >= 0 )
printf "check: %d (unsorted: should be 0)\n", check
dataset sortby wage
scalar check = ( min(diff(wage)) >= 0 ) && ( min(diff(lwage)) >= 0 )
printf "check: %d (sorted by wage: should be 1)\n", check
dataset sortby lwage
scalar check = ( min(diff(wage)) >= 0 ) && ( min(diff(lwage)) >= 0 )
printf "check: %d (sorted by lwage: should be 1)\n", check
dataset sortby orig_order
scalar check = ( min(diff(wage)) >= 0 ) && ( min(diff(lwage)) >= 0 )
printf "check: %d (back to original: should be 0)\n", check
</hansl>
Could you please try this script?
Good idea. Here's another little test script in the same spirit but
using sort():
<hansl>
open /usr/local/share/gretl/data/wooldridge/mroz.gdt
ols lwage 0 log(wage) --simple
series swage = sort(wage)
series slwage = sort(lwage)
# regression results should be the same as first time
ols slwage 0 log(swage) --simple
# should get two zeros below
eval min(swage - swage(-1))
eval min(slwage - slwage(-1))
</hansl>
Allin