get_covid {COVIDIBGE} | R Documentation |
Download, label, deflate and create survey design object for PNAD COVID19 microdata
Description
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.
Usage
get_covid(
year,
month,
vars = NULL,
labels = TRUE,
deflator = TRUE,
design = TRUE,
reload = TRUE,
curlopts = list(),
savedir = tempdir()
)
Arguments
year |
The year of the data to be downloaded. Must be a number equal to 2020. Vector not accepted. |
month |
The month of the year of the data to be downloaded. Must be number from 5 to 11. Vector not accepted. |
vars |
Vector of variable names to be kept for analysis. Default is to keep all variables. |
labels |
Logical value. If |
deflator |
Logical value. If |
design |
Logical value. If |
reload |
Logical value. If |
curlopts |
A named list object identifying the curl options for the handle when using functions from |
savedir |
Directory to save the downloaded data. Default is to use a temporary directory. |
Value
An object of class survey.design
or svyrep.design
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.
Note
For more information, visit the survey official website <https://www.ibge.gov.br/estatisticas/investigacoes-experimentais/estatisticas-experimentais/27946-divulgacao-semanal-pnadcovid1?t=o-que-e> 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.
Examples
covid.svy <- get_covid(year=2020, month=5, vars=c("C001","C002"),
labels=TRUE, deflator=TRUE, design=TRUE,
reload=TRUE, curlopts=list(), 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)