pof_design: Create POF survey object with its sample design

View source: R/pof_design.R

pof_designR Documentation

Create POF survey object with its sample design

Description

This function creates POF survey object with its sample design for analysis using survey package functions.

Usage

pof_design(data_pof)

Arguments

data_pof

A tibble of POF microdata read with read_pof function.

Value

An object of class survey.design or svyrep.design with the data from POF and its sample design.

Note

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

See Also

get_pof for downloading, labeling, deflating and creating survey design object for POF microdata.
read_pof for reading POF microdata.
pof_labeller for labeling categorical variables from POF microdata.
pof_deflator for adding deflator variables to POF microdata.
pof_example for getting the path of the POF toy example files.

Examples


# Using data read from disk
input_path <- pof_example(path="input_example.txt")
data_path <- pof_example(path="exampledata.txt")
dictionary.path <- pof_example(path="dictionaryexample.xls")
deflator.path <- pof_example(path="deflatorexample.xls")
pof.df <- read_pof(microdata=data_path, input_txt=input_path, vars=c("V0407","V0408"))
pof.df <- pof_labeller(data_pof=pof.df, dictionary.file=dictionary.path)
pof.df <- pof_deflator(data_pof=pof.df, deflator.file=deflator.path)

pof.svy <- pof_design(data_pof=pof.df)
# Calculating proportion of people's purchase of goods or services
if (!is.null(pof.svy)) survey::svymean(x=~V0408, design=pof.svy, na.rm=TRUE)

# Downloading data
pof.df2 <- get_pof(year=2017, selected=FALSE, anthropometry=FALSE, vars=c("V0407","V0408"),
                       labels=TRUE, deflator=TRUE, design=FALSE, savedir=tempdir())
pof.svy2 <- pof_design(data_pof=pof.df2)
# Calculating proportion of people's purchase of goods or services
if (!is.null(pof.svy2)) survey::svymean(x=~V0408, design=pof.svy2, na.rm=TRUE)

POFIBGE documentation built on March 25, 2022, 1:05 a.m.