pnadc_labeller: Label categorical variables from PNADC microdata

View source: R/pnadc_labeller.R

pnadc_labellerR Documentation

Label categorical variables from PNADC microdata

Description

This function labels categorical variables from PNADC microdata.

Usage

pnadc_labeller(data_pnadc, dictionary.file)

Arguments

data_pnadc

A tibble of PNADC microdata read with read_pnadc function.

dictionary.file

The dictionary file for selected survey available on official website:
Quarter (select the dictionary and input zip file) - https://ftp.ibge.gov.br/Trabalho_e_Rendimento/Pesquisa_Nacional_por_Amostra_de_Domicilios_continua/Trimestral/Microdados/Documentacao/.
Annual per Interview (select a dictionary xls file, according to the appropriated interview and, then, inside the documentation folder, choose the desired year) - https://ftp.ibge.gov.br/Trabalho_e_Rendimento/Pesquisa_Nacional_por_Amostra_de_Domicilios_continua/Anual/Microdados/Visita/.
Annual per Topic (select a dictionary xls file, according to the appropriated quarter related to the topic, inside the documentation folder) - https://ftp.ibge.gov.br/Trabalho_e_Rendimento/Pesquisa_Nacional_por_Amostra_de_Domicilios_continua/Anual/Microdados/Trimestre/.

Value

A tibble with the data provided from PNADC survey and its categorical variables as factors with related labels.

Note

For more information, visit the survey official website <https://www.ibge.gov.br/estatisticas/sociais/trabalho/9171-pesquisa-nacional-por-amostra-de-domicilios-continua-mensal.html?=&t=o-que-e> and consult the other functions of this package, described below.

See Also

get_pnadc for downloading, labeling, deflating and creating survey design object for PNADC microdata.
read_pnadc for reading PNADC microdata.
pnadc_deflator for adding deflator variables to PNADC microdata.
pnadc_design for creating PNADC survey design object.
pnadc_example for getting the path of the quarter PNADC toy example files.

Examples

# Using data read from disk
input_path <- pnadc_example(path="input_example.txt")
data_path <- pnadc_example(path="exampledata.txt")
dictionary.path <- pnadc_example(path="dictionaryexample.xls")
pnadc.df <- read_pnadc(microdata=data_path, input_txt=input_path, vars=c("VD4001","VD4002"))
pnadc.df <- pnadc_labeller(data_pnadc=pnadc.df, dictionary.file=dictionary.path)

# Downloading data
pnadc.df2 <- get_pnadc(year=2017, quarter=4, selected=FALSE, vars=c("VD4001","VD4002"),
                       defyear=2017, defperiod=4, labels=FALSE, deflator=FALSE, design=FALSE,
                       reload=TRUE, savedir=tempdir())
dictionary.path2 <- pnadc_example(path="dictionaryexample.xls")
pnadc.df2 <- pnadc_labeller(data_pnadc=pnadc.df2, dictionary.file=dictionary.path2)

PNADcIBGE documentation built on Nov. 19, 2023, 1:09 a.m.