get_covid {COVIDIBGE}R Documentation

Download, label, deflate and create survey design object for PNAD COVID19 microdata


Core function of package. With this function only, the user can download a PNAD COVID19 microdata from a month and get a sample design object ready to use with survey package functions.


  vars = NULL,
  labels = TRUE,
  deflator = TRUE,
  design = TRUE,
  savedir = tempdir()



The year of the data to be downloaded. Must be a number equal to 2020. Vector not accepted.


The month of the year of the data to be downloaded. Must be number from 5 to 11. Vector not accepted.


Vector of variable names to be kept for analysis. Default is to keep all variables.


Logical value. If TRUE, categorical variables will presented as factors with labels corresponding to the survey's dictionary.


Logical value. If TRUE, deflator variables will be available for use in the microdata.


Logical value. If TRUE, will return an object of class or It is strongly recommended to keep this parameter as TRUE for further analysis. If FALSE, only the microdata will be returned.


Directory to save the downloaded data. Default is to use a temporary directory.


An object of class or with the data from PNAD COVID19 and its sample design, or a tibble with selected variables of the microdata, including the necessary survey design ones.


For more information, visit the survey official website <> and consult the other functions of this package, described below.

See Also

read_covid for reading PNAD COVID19 microdata.
covid_labeller for labeling categorical variables from PNAD COVID19 microdata.
covid_deflator for adding deflator variables to PNAD COVID19 microdata.
covid_design for creating PNAD COVID19 survey design object.
covid_example for getting the path of the PNAD COVID19 toy example files.


covid.svy <- get_covid(year=2020, month=5, vars=c("C001","C002"),
                       labels=TRUE, deflator=TRUE, design=TRUE, savedir=tempdir())
# Calculating proportion of people temporarily away from work
if (!is.null(covid.svy)) survey::svymean(x=~C002, design=covid.svy, na.rm=TRUE)

[Package COVIDIBGE version 0.1.8 Index]