panel.overlaps: panel.overlaps

panel.overlapsR Documentation

panel.overlaps

Description

Identifies records within a panel data set that have overlapping observation periods for the same subject. Overlaps can indicate data entry errors or issues with data collection protocols.

Usage

panel.overlaps(dat, id.name = "id", t1.name = "t1", t2.name = "t2")

Arguments

dat

A data frame structured as panel data.

id.name

The character name of the identifying variable within dat, used to track subjects across multiple rows.

t1.name

The character name of the time variable within dat representing the start (left endpoint) of observation intervals.

t2.name

The character name of the time variable within dat representing the end (right endpoint) of observation intervals.

Value

Returns a data table listing subjects (identified by id.name) who have at least one instance of overlapping observation periods. Each row corresponds to a unique subject identified as having overlaps, with additional information or indicators related to the nature or extent of these overlaps. This output is crucial for data cleaning and ensuring the temporal accuracy of the panel data, allowing researchers to identify and rectify anomalies before conducting further analysis.


tvtools documentation built on Oct. 8, 2024, 5:09 p.m.