Description Usage Arguments Details Value Author(s) References Examples
The function provides interface for gretl estimation commands using R data frames, or gretl native data files.
1 2 3 4 5 6 7 8 9 10 11 | grmod(mdl,data,top = character(0),bottom = character(0),
input = list(matr = list(),char = character()),
output=list(matr=character(), char=character(),
series = character()))
# With gretl native data file; outputs coeff, vcov, etc
# mod <- grmod("arima 0 1 1; 0 1 1; lg --nc", "bjg.gdt")
# names(mod)
# With AirPassengers from datasets package
# grmod("arima 0 1 1; 0 1 1; log(AirPassengers) --nc",AirPassengers)
|
mdl |
quoted gretl estimation command, e.g. |
data |
can be one of two types:
(i) an R |
top |
quoted gretl script: it may contain e.g. code
for preliminary data transformations, or unrestricted
ols estimation before |
bottom |
quoted gretl script: designed for post-estimation, e.g
|
input |
determines additional optional input, for example, the matrix of initial values for optimization (typically of likelihood maximization for |
output |
determines additional optional components of the output list, e.g. p-value for some diagnostic model test, see Value below and entry for |
In the current version of the package, all gretl estimation commands
except for midasreg
are processed.
Panel data
If data
argument is a gretl data file with panel settings nothing special is needed. Otherwise, the first line of of top
argument should be setobs id time_id --panel-vars
(use actual names!).
Command blocks
Some of gretl estimation commands
use several lines of code, e.g. restrict
(with --full
option), system
, mle
, gmm
, etc.
restrict
: mdl
argument should consist of several lines encompassing all restrict
block, see Examples below
Other command blocks: mdl
argument should contain only the last line of the block (typically the first "word" of the last line is "end", e.g. end mle
); all previous lines shold be included into top
argument.
a list containing imported output of correspondent gretl command
output; if available $model
bundle is captured, otherwise available dollar-prefixed accessors are transmitted. Scalars, series, column and row vectors are rendered as R numeric vectors. Matrices of other shapes are rendered as R matrix objects. As always a user can execute run_grcli("help $vcv"), etc.
Oleh Komashko
Cottrell, A., and Lucchetti, R. (2018) "Gretl User's Guide," http://ricardo.ecn.wfu.edu/pub//gretl/manual/en/gretl-guide.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | set.seed(13)
dfr = data.frame(y = rnorm(20), x = rnorm(20))
grmod("ols y 0 x --simple-print",dfr)
grmod("ols diff(LRY) 0 diff(LRM)","denmark.gdt")
## Not run:
## command block example
# unrestricted linear regression
tp <- "ols diff(LRY) 0 diff(LRM) IBO -q"
# restrict block code:
md <-
"restrict --full
b[2] + b[3] = 0.3
end restrict"
# estimation
mod1 <- grmod(md,"denmark.gdt",top=tp)
names(mod1)
## prelimanary data manipulation example
pr <-
"list DEMOG = age educ female black married
list INCOME = finc25 finc35 finc50 finc75 finc100 finc101"
# estimate ordered probit
grmod("probit pctstck choice DEMOG INCOME wealth89 prftshr",
"pension.gdt",top=pr,type="ordered")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.