Learn R Programming

explore (version 0.8.0)

create_fake_data: Create fake data

Description

Fake data that can be used for unit-testing or demonstration

Usage

create_fake_data(
  obs = 1000,
  target_name = "target_ind",
  factorise_target = FALSE,
  target1_prob = 0.5,
  add_extreme = TRUE,
  flip_gender = FALSE,
  add_id = FALSE,
  seed = 123
)

Value

A dataframe

Arguments

obs

Number of observations

target_name

Variable name of target

factorise_target

Should target variable be factorised? (from 0/1 to facotr no/yes)?

target1_prob

Probability that buy = 1

add_extreme

Add an obervation with extreme values?

flip_gender

Should Male/Female be flipped in data?

add_id

Add an id-variable to data?

seed

Seed for randomization

Details

Variables in dataset:

  • id = Identifier

  • period = Year & Month (YYYYMM)

  • city_ind = Indicating if customer is residing in a city (1 = yes, 0 = no)

  • female_ind = Gender of customer is female (1 = yes, 0 = no)

  • fixedvoice_ind = Customer has a fixed voice product (1 = yes, 0 = no)

  • fixeddata_ind = Customer has a fixed data product (1 = yes, 0 = no)

  • fixedtv_ind = Customer has a fixed tv product (1 = yes, 0 = no)

  • mobilevoice_ind = Customer has a mobile voice product (1 = yes, 0 = no)

  • mobiledata_ind = Customer has a mobile data product (1 = yes, 0 = no)

  • bbi_speed_ind = Customer has a Broadband Internet (BBI) with speed

  • bbi_usg_gb = Broadband Internet (BBI) usage in Gigabyte (GB) last month

  • hh_single = Expected to be a Single Household (1 = yes, 0 = no)

Target in dataset:

  • target_ind (may be renamed) = Did customer buy a new product in next month? (1 = yes, 0 = no)