Learn R Programming

pdynmc (version 0.9.0)

plot.pdynmc: Plot Coefficient Estimates and Corresponding Ranges of Fitted Model.

Description

plot.pdynmc Plot coefficient estimates and corresponding coefficient estimate ranges for objects of class `pdynmc`.

Usage

# S3 method for pdynmc
plot(
  x,
  type = "fire",
  include.dum = FALSE,
  include.fur.con = FALSE,
  col.coefRange = 1,
  col.coefInitial = "darkgrey",
  col.coefEst = "royalblue",
  boxplot.coef = FALSE,
  ...
)

Arguments

x

An object of class `pdynmc`. The function requires twostep or iterative GMM estimates.

type

Wether to plot fitted values against residuals (argument 'fire'; default) or coefficient ranges (argument 'coef.range'; this requires twostep or iterative GMM estimates.

include.dum

Include estimates of parameters corresponding to time dummies (defaults to 'FALSE'; requires 'type = coef.range').

include.fur.con

Include estimates of parameters corresponding to further controls (defaults to 'FALSE'; requires 'type = coef.range').

col.coefRange

Specify color for plotting range of coefficient estimates (defaults to 'black'; requires 'type = coef.range').

col.coefInitial

Specify color for plotting initial coefficient estimates (defaults to 'darkgrey'; requires 'type = coef.range').

col.coefEst

Specify color for plotting coefficient estimate (defaults to 'royalblue'; requires 'type = coef.range').

boxplot.coef

Wether to draw boxplots for coefficient estimates (defaults to 'FALSE'); requires iterative GMM with at least 10 iterations and argument 'type = coef.range'. Proceed with caution as this argument is experimental.

...

further arguments.

Value

Plot fitted values against residuals ('type = fire') or coefficient estimates and coefficient estimate ranges ('type = coef.range') for object of class `pdynmc`. The latter plot requires twostep or iterative GMM estimates.

See Also

pdynmc for fitting a linear dynamic panel data model.

Examples

Run this code
# NOT RUN {
## Load data from plm package
if(!requireNamespace("plm", quietly = TRUE)){
 stop("Dataset from package \"plm\" needed for this example.
 Please install the package.", call. = FALSE)
} else{
 data(EmplUK, package = "plm")
 dat <- EmplUK
 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 = "twostep",
    opt.meth = "none")
 plot(m1)
 plot(m1, type = "coef.range")
}

# }
# NOT RUN {
## Load data from plm package
if(!requireNamespace("plm", quietly = TRUE)){
 stop("Dataset from package \"plm\" needed for this example.
 Please install the package.", call. = FALSE)
} else{
 data(EmplUK, package = "plm")
 dat <- EmplUK
 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 = "iterative",
    opt.meth = "none")
 plot(m1)
 plot(m1, type = "coef.range")
}
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab