Prepares a dataframe for the analysis in three steps:
Checks whether sex
, age
, and entry_date
have the
correct format and whether their specifications are plausible
Build the dataframe used for the analysis
Check each row of the dataframe for correctness and plausibility
prepare_data(
data,
reference_month,
reference_year,
usual_weekly_hours,
female_spec = "F",
male_spec = "M",
age_spec = NULL,
entry_date_spec = NULL
)
a data.frame which has no incorrect rows left and can be used to estimate the standard analysis model
a dataframe object as produced by read_data
which is to
be used in the analysis
a number indicating the reference month of the analysis
a number indicating the reference year of the analysis
an optional numeric representing the usual weekly working hours
a string or number indicating the way females are specified in the dataset
a string or number indicating the way males are specified in the dataset
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
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