Skip to Content
Practical Predictive Analytics
book

Practical Predictive Analytics

by Ralph Winters
June 2017
Beginner to intermediate
576 pages
15h 22m
English
Packt Publishing
Content preview from Practical Predictive Analytics

Merging scores back into the original dataframe

We will augment the original x2 dataframe with this new information by merging back by category, and then by sorting the dataframe by the rank of the coefficient. This will allow us to use this as a proxy for trend:

x2x <- x2 %>% left_join(xx4, by = "cat") %>% arrange(coef.rank, cat)# exclude some columns so as to fit on one pagehead(x2x[, c(-2, -3, -4, -8)]) > Source: local data frame [6 x 7]> >                   cat Year.1 Total.People    Total Not.Covered.Pct>                (fctr)  (int)        (dbl)    (dbl)           (dbl)> 1 MALE 18 to 24 YEARS   2012     15142.04 11091.86       0.2674787> 2 MALE 18 to 24 YEARS   2011     15159.87 11028.75       0.2725034> 3 MALE 18 to 24 YEARS   2010     14986.02 10646.88       0.2895460> 4 MALE 18 to 24 YEARS 2010 14837.14 10109.82 0.3186139 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Superstream: Analytics Engineering

Data Superstream: Analytics Engineering

Alistair Croll, Anna Filippova, Emilie Schario, Lewis Davies, Jacob Frackson, Benn Stancil, Nick Acosta, Elizabeth Caley
R: Predictive Analysis

R: Predictive Analysis

Tony Fischetti, Eric Mayor, Rui Miguel Forte
Python: Advanced Predictive Analytics

Python: Advanced Predictive Analytics

Ashish Kumar, Joseph Babcock

Publisher Resources

ISBN: 9781785886188Supplemental Content