---
title: "Stat. 652 Homework03"
author: "Your Name, first and last"
date: "`r format(Sys.time(), '%B %d, %Y')`"
format: html
---

- **Read:** 
       - [mdsr2e](https://mdsr-book.github.io/mdsr2e/) [Chapter 10](https://mdsr-book.github.io/mdsr2e/ch-modeling.html)
       - [mdsr2e](https://mdsr-book.github.io/mdsr2e/) [Chapter 11](https://mdsr-book.github.io/mdsr2e/ch-learningI.html)
       - Machine Learning with R, Second Edition, Chapter 5.  To access the book [CSUEB Library Databases A-Z](https://library.csueastbay.edu/az.php?a=s) > Safari Books Online, register and access the book
- **Problems:**
       - 11.7 Exercises: Problem 6a, Run Models 3. Decision Tree, using c5.0, 4. Random Forest, using training and test datasets, as described in part c of the problem.

Hint: For Problems 6a and 6b, explore the dataset before attempting to fit the models.  You will need to deal with the missing values before applying some or all of the models.  Which models do not work with missing data?

**Instructions:** Answer all questions in the space below the # headers.



# 11.7 Exercises: Problem 6a

Run Models 3. Decision Tree, using c5.0, 4. Random Forest, using training and test datasets, as described in part c of the problem.

The ability to get a good night’s sleep is correlated with many positive health outcomes. The NHANES data set contains a binary variable SleepTrouble that indicates whether each person has trouble sleeping.

For each of the following models:

- Build a classifier for SleepTrouble
- Report its effectiveness on the NHANES training data
- Make an appropriate visualization of the model
- Interpret the results. What have you learned about people’s sleeping habits?

You may use whatever variables you like, except for SleepHrsNight.

- Decision Tree, using c5.0
- Random Forest

First separate the NHANES data set uniformly at random into 75% training and 25% testing sets. 

### **Answer:**

Summarize your answer to the question here.  All code and comments should be below and your written answer above.

### **Code and Comments:**

```{r}

```

