How to delete a series in a loop?
by Logan Kelly
Hello,
I need to delete a series inside a loop. Is there a way to do this? What I am doing is loading data on a country, process the data, save some results, replace the data with the next country's in my data set. Below is my code that does not work:
loop i = 1..numcountry
cc = strsplit(ccode,i)
append "@datafile.xlsx" --time-series --sheet="@cc" --coloffset=0 --rowoffset=1
#Do some stuff
delete Q* # yields an error
delete R* # would yield an error if previous line did not
end loop
This of course yields the error:
You cannot delete series in this context
I understand that delete does not work in a loop, but is there a work around? Or a better way to handle repeated processes?
Thanks,
Logan
11 years, 4 months
Linux Gretl 9.12 and Gnuplot issue SOLVED
by Hugo Cohan
GNuplot 4.6.3-2 does work OK with Gretl 9.12
I found that the issue with a previous gnuplot version really was a problem with the Linux distro. Anyway, SOLVED!
11 years, 4 months
Restricted Fixed Effects
by Pindar
Hi there,
I need to estimate a fixed effect model with restricted coefficients and
then read out the new coefficients. Cos the --full option does not
include 'panel' models I thought to switch to LSDV.
In principle this works, but gretl crashes. I have too many units!
I found a script by Allin to use the --outfile trick in order to
retrieve restricted values, but since the values are not printed it's
also not applicable.
Would it be possible to extend the --full option at least for fixed
effects panel models?
Is there a third work-around?
Cheers
Leon
11 years, 4 months
About interacting with R
by yinung@Gmail
Dear all,
I am trying to write a function that can retrieve stock data via R from
Yahoo finance as follows.
This script is working both under my ubuntu and XP with gretl 1.9.12 cvs
build date 2013-05-06.
A problem occurred when I replace
getSymbols("@sym",return.class="ts",from="@s1",to="2012-08-02")
with
getSymbols("@sym",return.class="ts",from="@s1",to="@s2")
It seems that the second string replacement @s2 does not work. It cannot be
recognized as a valid argument in R.
Do anyone have an idea?
Thanks
Yi-Nung Yang
<hansl>
function list getsymbols(string sym[null],string s1[null], string s2[null])
foreign language=R
library(quantmod)
getSymbols("@sym",return.class="ts",from="@s1",to="2012-08-02")
tmpM <- @sym
gretl.export(tmpM)
end foreign
append "@dotdir/tmpM.csv"
list tmplist= *
return tmplist
end function
nulldata 9
string mys1="2012-07-22"
setobs 5 @mys1 --time-series
string mySym="MSFT"
string mys1="2012-07-22"
string mys2="2012-08-02"
list xlist = getsymbols(mySym,mys1,mys1)
</hansl>
11 years, 4 months
JOIN function
by Andreea Bolos
Hi everyone,
I am working on my master thesis and I have a data set in three different
excel files each on different lengths that need to me merged together. I
saved them as csv since I have some text variables but when trying the JOIN
function I always get error. I tried joining them with matching keys 2 by
2.
Is there somewhere a more detailed explanation of the join function?
Thank you for your help.
/Andreea
11 years, 4 months
Cluster option in ols not working with panel data
by Giuseppe Vittucci
There is a bug in the option "cluster" for clustered standard errors in
OLS estimates: they are not computed in panel data.
This is a simple code to reproduce the issue:
open greene14_1.gdt
logs C Q PF LF
series d = (unit <= 3)
ols l_C 0 l_Q l_PF l_LF
setobs unit year --panel-vars
ols l_C 0 l_Q l_PF l_LF --cluster=d
setobs 1 1
ols l_C 0 l_Q l_PF l_LF --cluster=d
The second and third estimates should give the same result.
However, the s.e. in the second estimate are equal to the first one...
Moreover, the same option cluster does not work and returns an error if
there is at least one missing observation.
Bye
Giuseppe
11 years, 4 months
Value labels
by Giuseppe Vittucci
I noted that the new version of gretl handles the value labels for
string-valued variables when it imports a dataset.
They are shown when I list the variable.
I wonder if there is some way to access/modify/drop these labels.
Thanks
Giuseppe
11 years, 4 months