I was thinking that we might want to map what we call "discrete" series
into what R calls "factors". The idea is quite simple, and exemplified in
the script below. My question to the list is: is this a good idea? Is it
worth the coding effort (very small IMO)?
Comments welcome.
<hansl>
nulldata 50
cont1 = normal()
cont2 = normal()
disc1 = floor(uniform(1,5))
disc2 = floor(uniform(4,18))
discrete disc1 disc2
list D = dataset
loop foreach i D
if !isdiscrete($i)
D -= $i
endif
endloop
matrix mD = D
mwrite(mD, "discrete.mat", 1)
foreign language=R --send-data
D <- gretl.loadmat("discrete.mat");
for (i in D) {gretldata[,i] <- as.factor(gretldata[,i])};
summary(gretldata);
end foreign
</hansl>
-------------------------------------------------------
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
-------------------------------------------------------