prepare_data: Prepares a dataframe for the analysis

Description Usage Arguments Value

View source: R/data_preparation.R

Description

Prepares a dataframe for the analysis in three steps:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
prepare_data(
  data,
  reference_month,
  reference_year,
  female_spec = "F",
  male_spec = "M",
  age_spec = NULL,
  entry_date_spec = NULL,
  ignore_plausibility_check = FALSE,
  prompt_data_cleanup = FALSE
)

Arguments

data

a dataframe object as produced by read_data which is to be used in the analysis

reference_month

a number indicating the reference month of the analysis

reference_year

a number indicating the reference year of the analysis

female_spec

a string or number indicating the way females are specified in the dataset.

male_spec

a string or number indicating the way males are specified in the dataset

age_spec

a string indicating the age specification, can be one of NULL, "age", "birthyear", or "date_of_birth". If this parameter is set to NULL, the function automatically tries to infers the specification

entry_date_spec

a string indicating the entry_date specification, can be one of NULL, "years", "entry_year", or "entry_date". If this parameter is set to NULL, the function automatically tries to infers the specification

ignore_plausibility_check

a boolean indicating whether the user wants to ignore implausible data. If TRUE, the implausible data is interpreted as being correct.

prompt_data_cleanup

a boolean indicating whether the user wants to be prompted regarding incorrect data values. If FALSE, the analysis will run without the incorrect data only.

Value

a data.frame which has no incorrect rows left and can be used to estimate the standard analysis model


logib documentation built on Aug. 27, 2020, 5:06 p.m.