View source: R/pdynmc_fitMethods.R
model.matrix.pdynmc | R Documentation |
model.matrix.pdynmc
extracts instrument matrix of an
object of class 'pdynmc'.
## S3 method for class 'pdynmc'
model.matrix(object, sparse = TRUE, ...)
object |
An object of class 'pdynmc'. |
sparse |
Whether to return a sparse matrix (if set to 'TRUE') or a regular matrix (if set to 'FALSE'). |
... |
further arguments. |
Extracts instrument matrix from an object of class 'pdynmc'.
Markus Fritsch
pdynmc
for fitting a linear dynamic panel data model.
## Load data
data(ABdata, package = "pdynmc")
dat <- ABdata
dat[,c(4:7)] <- log(dat[,c(4:7)])
dat <- dat[c(1:140), ]
## Code example
m1 <- pdynmc(dat = dat, varname.i = "firm", varname.t = "year",
use.mc.diff = TRUE, use.mc.lev = FALSE, use.mc.nonlin = FALSE,
include.y = TRUE, varname.y = "emp", lagTerms.y = 2,
fur.con = TRUE, fur.con.diff = TRUE, fur.con.lev = FALSE,
varname.reg.fur = c("wage", "capital", "output"), lagTerms.reg.fur = c(1,2,2),
include.dum = TRUE, dum.diff = TRUE, dum.lev = FALSE, varname.dum = "year",
w.mat = "iid.err", std.err = "corrected", estimation = "onestep",
opt.meth = "none")
model.matrix(m1)
## Load data
data(ABdata, package = "pdynmc")
dat <- ABdata
dat[,c(4:7)] <- log(dat[,c(4:7)])
m1 <- pdynmc(dat = dat, varname.i = "firm", varname.t = "year",
use.mc.diff = TRUE, use.mc.lev = FALSE, use.mc.nonlin = FALSE,
include.y = TRUE, varname.y = "emp", lagTerms.y = 2,
fur.con = TRUE, fur.con.diff = TRUE, fur.con.lev = FALSE,
varname.reg.fur = c("wage", "capital", "output"), lagTerms.reg.fur = c(1,2,2),
include.dum = TRUE, dum.diff = TRUE, dum.lev = FALSE, varname.dum = "year",
w.mat = "iid.err", std.err = "corrected", estimation = "onestep",
opt.meth = "none")
model.matrix(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.