Skip to Content
Practical Predictive Analytics
book

Practical Predictive Analytics

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

Running a regression with imputed values

Now that you have imputed a value for age, you will be able to run models such as linear regression without having to discard missing values.

Let's try a regression with imputation #2.

First, extract impute #2:

impute.2 <- subset(all_imputed_df,.imp=='2')  

Next, run the summary() function at the console to insure there are no more NAs:

> summary(impute.2).imp   .id   Age  Gender0: 0 1  : 1 Min. :20.00 M:10001: 0 10  : 1 1st Qu.:23.00 F:10002:2000 100 : 1 Median :28.00  3: 0 1000 : 1 Mean :27.58  4: 0 1001 : 1 3rd Qu.:32.00  5: 0 1002 : 1 Max. :35.00    (Other):1994              EducationRegular High School Diploma    :522Bachelor's Degree      :323Some College, 1 or More Years, No Degree:2959th Grade to 12th Grade, No Diploma :169 ...
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