A function that imports the ETS data as a stata file, converts it to rds format, cleans it to a tidy format, and finally munges required variables for future analysis. Data can be applied for here

clean_munge_ets_2016(data_path = NULL, return = TRUE, save = TRUE,
  save_name = "clean_ets_2016",
  save_path = "~/data/tb_data/tbinenglanddataclean",
  save_format = "rds", verbose = TRUE)

Arguments

data_path

A character string containing the file pathway for the 2016 ETS data.

return

Logical, defaults to TRUE. Specifies whether to return cleanded data.

save

Logical, defaults to FALSE. Specifies whether to save data

save_name

A character string containing the name to save the tidy ETS data under.

save_path

A character string containing the file pathway to the folder into which to save the tidy ETS data for the 2016 ETS data.

save_format

A character vector specifying the format/formats to save the data into, defaults to rds. Currently csv is also supported. See save_data for details.

verbose

A logical indicating whether summary information should be provided.

Value

A tidy tibble of TB notficiations in England from 2000 to 2016, with a row for each notification.

Details

Function has 3 distinct sections:

  • Data Import

  • Setting factor variable baslines

  • Munge new variables

Examples