CasesTable {DataCombine} | R Documentation |
Create reports cases after listwise deletion of missing values for time-series cross-sectional data.
Description
Create reports cases after listwise deletion of missing values for time-series cross-sectional data.
Usage
CasesTable(data, GroupVar, TimeVar, Vars)
Arguments
data |
a data frame with the full sample. |
GroupVar |
a character string specifying the variable in |
TimeVar |
an optional character string specifying the variable in
|
Vars |
a character vector with variables names from |
Value
If TimeVar
is specified then a data frame is returned with
three colums. One identifying the GroupVar
and two others specifying
each unique value of GroupVar
's first and last observation time
post-listwise deletion of missing values.
If TimeVar
is not specified, then a vector of unique GroupVar
post-listwise deletion of missing values is returned.
Examples
# Create dummy data
ID <- rep(1:4, 4)
time <- rep(2000:2003, 4)
a <- rep(c(1:3, NA), 4)
b <- rep(c(1, NA, 3:4), 4)
Data <- data.frame(ID, time, a, b)
# Find cases that have not been listwise deleted
CasesTable(Data, GroupVar = 'ID')
CasesTable(Data, GroupVar = 'ID', Vars = 'a')
CasesTable(Data, GroupVar = 'ID', TimeVar = 'time', Vars = 'a')