ThrowAwayDataForBalance: Achieve Balance over Time Period and Respondent by Crude...

Description Usage Arguments Examples

Description

Statistically this is a very crude method, with potential bias from a response driven sampling method. It's meant for quick-and-dirty analyses of a single variable over time and until more sophisticated missing data procedures are integrated with NLSdata.

Usage

1
ThrowAwayDataForBalance(data, var.name, id = "PUBID.1997")

Arguments

data

a data frame

var.name

variable to achieve balance with respect to

id

id variable, also to achieve balance with respect to

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  codebook <- system.file("Investigator", "Religion.cdb", package = "NLSdata")
  csv.extract <- system.file("Investigator", "Religion.csv", package = "NLSdata")

  nls.obj <- CreateNLSdata(codebook, csv.extract)

  # Since only two people answered the question that year, excluding it from the analysis

  religion.df <- CreateTimeSeriesDf(nls.obj, "YSAQ_282A2")
  religion.df <- religion.df[religion.df$year != 2006, ]

  religion.df <- ThrowAwayDataForBalance(religion.df, "YSAQ_282A2")
  table(religion.df$year)
  head(table(religion.df$PUBID.1997))

google/NLSdata documentation built on May 17, 2019, 7:43 a.m.