Logan, thanks a lot, but e.g. with anscombe.gdt open this code
strings explainedVars = array(1)
explainedVars[1] = "x"
strings explanatoryVars = array(1)
explanatoryVars[1] = "y1(-1)"
ols @explainedVars[1] @explanatoryVars[1]
gives me the following message
Unexpected symbol '@'
Where is the problem?
Daniel
______________________________________________________________
> Od: <gretl-users-request@lists.wfu.edu>
> Komu: <gretl-users@lists.wfu.edu>
> Datum: 26.12.2014 18:05
> Předmět: Gretl-users Digest, Vol 95, Issue 17
>
Send Gretl-users mailing list submissions to
gretl-users@lists.wfu.edu
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.wfu.edu/mailman/listinfo/gretl-users
or, via email, send a message with subject or body 'help' to
gretl-users-request@lists.wfu.edu
You can reach the person managing the list at
gretl-users-owner@lists.wfu.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gretl-users digest..."
Today's Topics:
1. Automating regressions on various variables (Daniel Bencik)
2. Re: Automating regressions on various variables (Logan Kelly)
----------------------------------------------------------------------
Message: 1
Date: Fri, 26 Dec 2014 17:34:45 +0100
From: Daniel Bencik <eubie@centrum.cz>
Subject: [Gretl-users] Automating regressions on various variables
To: "gretl-users" <gretl-users@lists.wfu.edu>
Message-ID: <20141226173445.09ED69DB@centrum.cz>
Content-Type: text/plain; charset="utf-8"
Hello,?
?
I have several measures of volatility v1, v2, v3 and their 5-day and 22-day averages (v1_5, v1_22, etc.) loaded into the session. What I would like is to write a loop over the explained and explanatory variables so that I have one code for OLS estimation into which I just feed different data. The pseudocode should look something like this
?
strings explainedVars = array(3)
explainedVars[1] = "v1"
explainedVars[2] = "v2"
explainedVars[3] = "v3"
?
strings explanatoryVars = array(9)
explanatoryVars[1] = "v1(-1)"
explanatoryVars[2] = "v1_5(-1)"
explanatoryVars[3] = "v1_22(-1)"?
...
explanatoryVars[9] = "v3_22(-1)"?
?
loop i = 1 to 3
?loop j = 1 to 9
? ? ols?explainedVars[i] ?explanatoryVars[j]
?endloop
endloop
?
The OLS line is the one that is not working for me, I do not know how to tell the estimation command that the string?explainedVars[i] should be taken as a series name. The problem is naturally a simplified version of the real problem.
?
Any help is much appreciated,?
Daniel
?
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20141226/943d850d/attachment-0001.html
------------------------------
Message: 2
Date: Fri, 26 Dec 2014 16:46:56 +0000
From: Logan Kelly <logan.kelly@uwrf.edu>
Subject: Re: [Gretl-users] Automating regressions on various variables
To: Gretl list <gretl-users@lists.wfu.edu>
Message-ID: <cqqpy2dn7nsfutsfkvsjmj6d.1419612412068@email.android.com>
Content-Type: text/plain; charset="utf-8"
You nee to use the @ symbols to signify a string substitution. Try
ols @explainedVars[i] @explanatoryVars[j]
Logan
Sent from my T-Mobile 4G LTE Device
-------- Original message --------
From: Daniel Bencik <eubie@centrum.cz>
Date:12/26/2014 10:37 AM (GMT-06:00)
To: gretl-users <gretl-users@lists.wfu.edu>
Cc:
Subject: [Gretl-users] Automating regressions on various variables
Hello,
I have several measures of volatility v1, v2, v3 and their 5-day and 22-day averages (v1_5, v1_22, etc.) loaded into the session. What I would like is to write a loop over the explained and explanatory variables so that I have one code for OLS estimation into which I just feed different data. The pseudocode should look something like this
strings explainedVars = array(3)
explainedVars[1] = "v1"
explainedVars[2] = "v2"
explainedVars[3] = "v3"
strings explanatoryVars = array(9)
explanatoryVars[1] = "v1(-1)"
explanatoryVars[2] = "v1_5(-1)"
explanatoryVars[3] = "v1_22(-1)"
...
explanatoryVars[9] = "v3_22(-1)"
loop i = 1 to 3
loop j = 1 to 9
ols explainedVars[i] explanatoryVars[j]
endloop
endloop
The OLS line is the one that is not working for me, I do not know how to tell the estimation command that the string explainedVars[i] should be taken as a series name. The problem is naturally a simplified version of the real problem.
Any help is much appreciated,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20141226/8bda7d3a/attachment-0001.html
------------------------------
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
End of Gretl-users Digest, Vol 95, Issue 17
*******************************************