fun_data_import: Import the data from MICS

View source: R/fun_data_import.r

fun_data_importR Documentation

Import the data from MICS

Description

Only import data from MICS. Not for genderal use

Usage

fun_data_import(
  country = "Pakistan",
  dataset = "hl",
  var_id = c("HH1", "HH2", "HL1"),
  var_interested_identify = c("disability", "wscore", "windex5r"),
  var_interested_match = c("ST3$", "TS5B", "TS6"),
  var_sampling_weight = "hhweight",
  level = 1
)

Arguments

country

which country's data to be imported

dataset

which data set need to be imported. Options include "hl", "ch", "fs", "wm", "mn", "hh", and others

var_id

which variables use to generate unique id. hh is c("HH1", "HH2"), others more likely is c("HH1", "HH2", "HL1")

var_interested_identify

identify names of variables. For example, for variable "gender", you need input "gender"

var_interested_match

match the variables by start_with. for example, for series of variables "FCF1", "FCF2", "FCF3", FCF4", you can easily input "FCF". Then the function will extract all the variables start with "FCF"

var_sampling_weight

sampling weight

Author(s)

Shanquan CHEN shanquan0301@gmial.com

Examples

# import from hl
dat_hl <- lapply(country_name, FUN = fun_data_import,
                 dataset = "hl",
                 var_id = c("HH1", "HH2", "HL1"),
                 var_interested_identify = c("HL4", "HL6", "HH6", "ED2A", "melevel", "caretakerdis"),
                 var_interested_match = c("HL5", "HT12", "windex5", "windex10", "disability"),
                 var_sampling_weight = "hhweight")

dat_hl <- do.call("bind_rows", dat_hl)


shanquan0301/DataDescription documentation built on March 13, 2024, 2:49 a.m.