Package 'plattice'

Title: Lattice Plot for Panel Data
Description: It creates a lattice plot to visualize panel or longitudinal data. The observed values are plotted as dots and the fitted values as lines, both against time. The plot is customizable and easy to edit, even if you do not know how to construct a lattice plot from scratch.
Authors: Michail Tsagris [aut, cre], Christos Adam [aut]
Maintainer: Michail Tsagris <[email protected]>
License: GPL (>= 2)
Version: 1.0
Built: 2024-11-26 06:33:23 UTC
Source: CRAN

Help Index


This is an R package that provides lattice plot for panel data.

Description

It creates a lattice plot to visualize panel or longitudinal data. The observed values are plotted as dots and the fitted values as lines, both against time. The plot is customizable and easy to edit, even if you do not know how to construct a lattice plot from scratch.

Details

Package: plattice
Type: Package
Version: 1.0
Date: 2022-10-01
License: GPL-2

Maintainers

Michail Tsagris [email protected]

Author(s)

Michail Tsagris [email protected], Christos Adam [email protected].


Lattice plot of panel data along with the model fitted values

Description

Lattice plot of panel data along with the model fitted values.

Usage

plattice(x, rows, pcol = "blue", psize = 2, lcol = "red", lsize = 1,
legcol = "orange", xlabel = NULL, ylabel = NULL, y_labels = NULL)

Arguments

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.

Value

A lattice plot with as many diagrams as the number of groups.

Author(s)

Christos Adam and Michail Tsagris.

Examples

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)