O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Generating the data

Next, generate the membership file with 1,000 members and assign it to the member dataframe. The wakefield package uses specialized functions to generate typical values for each of the specified variables:

  • The gender function will generate M, or F with a 50% chance of any individual row being a male or female
  • The set.seed(1010) directive guarantees that the results will be the same no matter how many times you run the code
  • The r_sample_replace() function will generate a unique member ID with a value from 1 to 1000
  • The income, children, employment, level, grad, year, state, and zip_code variables are all randomly generated without supplying any specialized parameters

Open up a new script window, and run the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required