append in the GUI fails silently
by Sven Schreiber
Hi,
I had the following case: appending an (treated as undated) dataset to
another one (also nominally undated). To cut the long story short, I had
extra series in the "outer" dataset. In the console, gretl gave the
error message "alignment of new series unclear" or so. However, in the
GUI, there was no error message, and nothing happened, leaving me
puzzled at first. Apparently, the error message doesn't make it to the
user level.
thanks
sven
2 days
Re: New Sampling Package for Gretl
by Riccardo (Jack) Lucchetti
On 13/05/2025 07:38, Edward Ugarte Calderon wrote:
> Hello *Gretl-devel* team
> I would like to share a package I have developed that enhances sampling
> methods and finite population corrections in Gretl. This package
> improves statistical estimation accuracy and integrates seamlessly into
> Gretl’s framework.
> 📌 *Package details:*
>
> * *Format:* |.gfn|
> * *Compatibility:* Tested on the latest version of Gretl
> * *Functionality:*
> * Optimized sample size calculations, considering finite population
> corrections
> * Dynamic error margin adjustments for statistical estimations
> * Modular integration within Gretl for ease of use and adaptability
>
> Since direct file attachments are not supported, I would like to ask
> about the best method to share this package with the community. Is there
> a recommended platform for uploading the package, or any preferred
> format for submission?
> I appreciate any guidance and feedback on its implementation. I look
> forward to contributing to Gretl’s development with this work!
Hello Edward, and thanks for your work. The information I think you want
is in the "Function package guide" (a pdf file you can find from the
"Help" menu), section 3.5.
In short, however, the thing is very simple: when you edit the package
properties via the appropriate GUI element, the "Save" button gives you
the option of uploading your package to the gretl server, so we can
start the moderation process.
Even shorter: read section 4 of
https://gretl.sourceforge.net/gfnguide/gfn_for_dummies.html
Thanks for your work!
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
2 days, 3 hours
gretl-devel@gretlml.univpm.it
by Edward Ugarte
# 📌 Inicialización para evitar errores en Gretl
nulldata 1
# 📌 Cálculo del error estándar (E) con validación
function scalar calcula_E(scalar sigma, scalar z, scalar n)
nulldata 1
if n <= 0
error "El tamaño de muestra (n) debe ser mayor que cero."
return NA
endif
return z * (sigma / sqrt(n))
end function
# 📌 Tamaño de muestra para poblaciones infinitas con proporciones
function scalar muestra_inf_prop(scalar p, scalar z)
nulldata 1
scalar n = (z^2 * p * (1 - p)) / (0.05^2) # Margen de error 5%
return n
end function
# 📌 Tamaño de muestra para poblaciones infinitas con desviación estándar
function scalar muestra_inf_desv(scalar sigma, scalar z)
nulldata 1
scalar n = (z^2 * sigma^2) / (1^2) # Error base de 1 unidad
return n
end function
# 📌 Tamaño de muestra para poblaciones finitas con corrección en proporciones
function scalar muestra_fin_prop(scalar p, scalar z, scalar N)
nulldata 1
scalar muestra_inf = muestra_inf_prop(p, z)
return muestra_inf / (1 + (muestra_inf - 1) / N)
end function
# 📌 Tamaño de muestra para poblaciones finitas con corrección en desviación estándar
function scalar muestra_fin_desv(scalar sigma, scalar z, scalar N)
nulldata 1
scalar muestra_inf = muestra_inf_desv(sigma, z)
return muestra_inf / (1 + (muestra_inf - 1) / N)
end function
# 📌 Ejemplo de uso del paquete
print "Ejemplo: Cálculo del error estándar"
print calcula_E(10, 1.96, 100)
# 📌 README Integrado
print "======================================================"
print "samplingToolkit.gfn – Herramientas de muestreo en Gretl"
print "======================================================"
print "Autor: Edward Ugarte"
print "Versión: 1.0"
print "Fecha: 20 de mayo de 2025"
print "Contacto: edwugarte(a)hotmail.com"
print "------------------------------------------------------"
print "Descripción:"
print "Este paquete permite calcular el tamaño de muestra en diferentes escenarios:"
print "- Poblaciones infinitas con proporciones y desviación estándar."
print "- Poblaciones finitas con corrección en proporciones y desviación estándar."
print "------------------------------------------------------"
print "Instrucciones:"
print "1. Guarda este archivo como 'samplingToolkit.gfn'."
print "2. En Gretl, usa: include samplingToolkit.gfn"
print "3. Ejecuta las funciones para calcular tamaños de muestra."
print "------------------------------------------------------"
print "Ejemplo de uso:"
print "print calcula_E(10, 1.96, 100)"
print "------------------------------------------------------"
print "Notas importantes:"
print "- Usa valores adecuados de Z (ej. 1.96 para 95% confianza)."
print "- Define correctamente p y σ según el tipo de muestreo."
print "- Asegura que N sea mayor que n en poblaciones finitas."
print "------------------------------------------------------"
2 days, 3 hours
New Sampling Package for Gretl
by Edward Ugarte Calderon
Hello Gretl-devel team
I would like to share a package I have developed that enhances sampling methods and finite population corrections in Gretl. This package improves statistical estimation accuracy and integrates seamlessly into Gretl’s framework.
📌 Package details:
* Format: .gfn
* Compatibility: Tested on the latest version of Gretl
* Functionality:
* Optimized sample size calculations, considering finite population corrections
* Dynamic error margin adjustments for statistical estimations
* Modular integration within Gretl for ease of use and adaptability
Since direct file attachments are not supported, I would like to ask about the best method to share this package with the community. Is there a recommended platform for uploading the package, or any preferred format for submission?
I appreciate any guidance and feedback on its implementation. I look forward to contributing to Gretl’s development with this work!
Best regards,
1 week, 3 days
regls and missings in the middle
by Sven Schreiber
Hi all,
it looks as if regls (Lasso...) isn't checking for missings that happen
somewhere in the middle of the data. Implicitly this is acknowledged by
comments in the example code snippets in the regls help document
("without missing values..." etc.). I just saw some internal data errors
happening because of that. I guess it would be good if regls checked for
such missings and then fails more gracefully.
This is with gretl 2025a.
thanks
sven
2 weeks, 2 days
gnuplot cmd refuses to deal with single obs
by Sven Schreiber
Hi,
gnuplot complains about missing values when only a single obs (row) is
provided, at least in matrix format. Example:
<hansl>
m1 = {1,2,3}
m2 = {1,2,2}
m = m1 | m2
gnuplot --matrix=m --output=display
gnuplot --matrix=m1 --output=display # fails
</hansl>
I would expect that with a single obs the plot only contains some points
(here: two) directly vertically above the respective x-axis value (here
in m1: 3). I see no intrinsic reason why this wouldn't make sense or
wouldn't be possible.
cheers
sven
2 weeks, 4 days