plattice | R Documentation |
Lattice plot of panel data along with the model fitted values.
plattice(x, rows, pcol = "blue", psize = 2, lcol = "red", lsize = 1, legcol = "orange", xlabel = NULL, ylabel = NULL, y_labels = NULL)
x |
A data frame with 4 columns of this specific order. Column 1: the grouping variable. Column 2: the time periods. Column 3: the observed response values. Column 4: the fitted values. |
rows |
The number of rows the lattice plot will contain. |
pcol |
The colour of the points (observed response values). |
psize |
The size of the points (observed response values). |
lcol |
The colour of the line of the fitted values. |
lsize |
The size of the line of the fitted values. |
legcol |
The colour of the background of the title of each sub-graph. |
xlabel |
The label of the x-axis. |
ylabel |
The label of the y-axis. |
y_labels |
A vector with the numbers to appear in the y-axis. If left NULL, 10 equidistant values will appear. |
A lattice plot with as many diagrams as the number of groups.
Christos Adam and Michail Tsagris.
y <- rnorm(120, 3, 1) yhat <- 3 * y + rnorm(120, 0, 0.4) id <- rep( c("DENMARK", "FRANCE", "GERMANY", "GREECE", "IRELAND", "ITALY"), 20) a <- data.frame( country = id, year = rep(2000:2019, each = 6), y = y, yhat = yhat) plattice(a, rows = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.