-----Original Message-----
> 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/download
>> <
https://sourceforge.net/projects/gretl/files/datafiles/wooldridge.ta
>> r.gz/download> 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>
I can confirm that something unexpected's going on:
If I run Jack's script on the Wooldridge version of mroz.gdt, I get "check =
0" in all 4 cases. Allin's script on the same data set gives identical regression
results in the 2 cases, and the "eval" statements return 0's as expected.
Running the same 2 scripts on the Hill et al version of mroz, I get the expected results
from Jack's script, but different regression results from Allin's. Both eval
statements still return 0's though:
gretl version 2019c-git
Current session: 2019-05-31 15:38
#open mroz.gdt
? ols lwage 0 log(wage) --simple
OLS, using observations 1-428
Dependent variable: lwage
coefficient std. error t-ratio p-value
-------------------------------------------------------
const 0.000000 0.000000 NA NA
l_wage 1.00000 0.000000 NA NA
SSR = 0, R-squared = 1.000000
Warning: generated missing values
? 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
OLS, using observations 326-428 (n = 103)
Dependent variable: slwage
coefficient std. error t-ratio p-value
---------------------------------------------------------
const 1.92669 0.0317078 60.76 2.41e-081 ***
l_swage 0.411814 0.0496341 8.297 4.90e-013 ***
SSR = 8.63157, R-squared = 0.405323
Warning: generated missing values
? eval min(swage - swage(-1))
0
? eval min(slwage - slwage(-1))
0
I hope this helps,
Peter