Hi Allin,
I have 2 questions today:
1 As I was trying to create a model using a script, I came across this strange error.
Using the wage1 dataset, if I do the following script to create an icon of a model, it
gives me an error:
gretl version 2022b-git
Current session: 2022-05-30 09:04
? list basic = educ exper tenure female married smsa trade services profocc
Replaced list basic
? "basic" <- ols lwage 0 basic --robust
"basic" <- ols
The symbol 'ols' is
undefined
Data error
Error executing script: halting
"basic" <- ols lwage 0 basic --robust
If instead, I change the model name to “basic1” for example, there is no problem.
In the icon view, I can change the model icon name from “basic1" to “basic” no
problem either.
2 How can I change the following script without the 2 loops?
<hansl>
list full = educ female exper tenure numdep \
nonwhite smsa northcen south west construc ndurman trcommpu trade \
services profserv profocc clerocc servocc
matrix fullid = {} # do this the dumb way first
loop i=1..nelem(full)
fullid |= varnum(varname(full[i]))
endloop
"model_full" <- ols lwage 0 full --robust
matrix pvalues = 2*pvalue(t,$df,abs($coeff) ./ $stderr)
matrix id = pvalues .> 0.05
list shortlist = full[1:4]
loop i=5..nelem(full)
if id[i+1] == 0
shortlist += varnum(varname(full[i]))
endif
endloop
"model_part" <- ols lwage 0 shortlist —robust
</hansl>