get_pof | R Documentation |
Core function of package. With this function only, the user can download a POF microdata from a year and get a sample design object ready to use with survey
package functions.
get_pof( year, selected = FALSE, anthropometry = FALSE, vars = NULL, labels = TRUE, deflator = TRUE, design = TRUE, savedir = tempdir() )
year |
The year of the data to be downloaded. Must be a number equal to 2008 or 2017. Vector not accepted. |
selected |
Logical value. If |
anthropometry |
Logical value. If |
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 |
savedir |
Directory to save the downloaded data. Default is to use a temporary directory. |
An object of class survey.design
or svyrep.design
with the data from POF 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 <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.
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_design for creating POF survey design object.
pof_example for getting the path of the POF toy example files.
pof.svy <- get_pof(year=2017, selected=FALSE, anthropometry=FALSE, vars=c("V0407","V0408"), labels=TRUE, deflator=TRUE, design=TRUE, savedir=tempdir()) # 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) pof.svy2 <- get_pof(year=2017, selected=TRUE, anthropometry=FALSE, vars=c("V4104","V4105"), labels=TRUE, deflator=TRUE, design=TRUE, savedir=tempdir()) # Calculating proportion of reasons for non-routine trips indicated by people if (!is.null(pof.svy2)) survey::svymean(x=~V4104, design=pof.svy2, na.rm=TRUE) pof.svy3 <- get_pof(year=2017, selected=FALSE, anthropometry=TRUE, vars=c("V7102","V7104"), labels=TRUE, deflator=TRUE, design=TRUE, savedir=tempdir()) # Calculating proportion of people who followed some type of diet if (!is.null(pof.svy3)) survey::svymean(x=~V7104, design=pof.svy3, na.rm=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.