tscsPlot: Plot observed and imputed time-series for a single...

View source: R/diag.r

tscsPlotR Documentation

Plot observed and imputed time-series for a single cross-section

Description

Plots a time series for a given variable in a given cross-section and provides confidence intervals for the imputed values.

Usage

tscsPlot(
  output,
  var,
  cs,
  draws = 100,
  conf = 0.9,
  misscol = "red",
  obscol = "black",
  xlab,
  ylab,
  main,
  pch,
  ylim,
  xlim,
  frontend = FALSE,
  plotall = FALSE,
  nr,
  nc,
  pdfstub,
  ...
)

Arguments

output

output from the function amelia.

var

the column number or variable name of the variable to plot.

cs

the name (or level) of the cross-sectional unit to plot. Maybe a vector of names which will panel a window of plots

draws

the number of imputations on which to base the confidence intervals.

conf

the confidence level of the confidence intervals to plot for the imputated values.

misscol

the color of the imputed values and their confidence intervals.

obscol

the color of the points for observed units.

xlab

x axis label

ylab

y axis label

main

overall plot title

pch

point shapes for the plot.

ylim

y limits (y1, y2) of the plot.

xlim

x limits (x1, x2) of the plot.

frontend

a logical value for use with the AmeliaView GUI.

plotall

a logical value that provides a shortcut for ploting all unique values of the level. A shortcut for the cs argument, a TRUE value overwrites any cs argument.

nr

the number of rows of plots to use when ploting multiple cross-sectional units. The default value will try to minimize this value to create a roughly square representation, up to a value of four. If all plots do not fit on the window, a new window will be started.

nc

the number of columns of plots to use. See nr

pdfstub

a stub string used to write pdf copies of each window created by the plot. The default is not to write pdf output, but any string value will turn on pdf output to the local working directory. If the stub is mystub, then plots will be saved as mystub1.pdf, mystub2.pdf, etc.

...

further graphical parameters for the plot.

Details

The cs argument should be a value from the variable set to the cs argument in the amelia function for this output. This function will not work if the ts and cs arguments were not set in the amelia function. If an observation has been overimputed, tscsPlot will plot both an observed and an imputed value.


Amelia documentation built on May 29, 2024, 2:17 a.m.