Learn R Programming

pdynmc (version 0.9.12)

fitted.pdynmc: Extract Fitted Values of Fitted Model.

Description

fitted.pdynmc extracts fitted values of an object of class `pdynmc`.

Usage

# S3 method for pdynmc
fitted(object, step = object$iter, na.rm = FALSE, ...)

Value

Extract fitted values from object of class `pdynmc`.

Arguments

object

An object of class `pdynmc`.

step

An integer denoting the iteration step for which fitted values are extracted (defaults to last iteration step used for obtaining parameter estimates).

na.rm

A logical variable indicating whether missing values should be removed from the vector of fitted values (defaults to `FALSE`).

...

further arguments.

Author

Markus Fritsch

See Also

pdynmc for fitting a linear dynamic panel data model.

Examples

Run this code
## 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")
fitted(m1, na.rm = TRUE)

# \donttest{
## Load data
 data(ABdata, package = "pdynmc")
 dat <- ABdata
 dat[,c(4:7)] <- log(dat[,c(4:7)])

## Further 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")
 fitted(m1, na.rm = TRUE)
# }


Run the code above in your browser using DataLab