/usr/share/gretl/scripts/ps12-1.inp is in gretl-common 1.9.14-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | include criteria.gfn
# PS12.1, to illustrate Example 12.1
open data4-5
genr y = ln(wlfp/(100-wlfp))
# estimate the logit model
ols y 0 yf educ ue urb wh
# save predicted values
genr lyhat=$yhat
# take antilog and correct for bias in log model
genr y1=exp(lyhat+($ess/(2*$df)))
# predict the participation rate and compute the errors
genr wlfphat = 100*y1/(1+y1)
genr error = wlfp - wlfphat
# compute ESS and adjusted model selection criteria for logit model
genr ess = sum(error*error)
criteria(ess, 50, 6)
# estimate linear model
ols wlfp 0 yf educ ue urb wh
|