---
title: "Rmarkdown with code"
author: "Sadaf Masood"
date: "02/12/2020"
---

I am going to import the proper libraries and load the addhealth4 data, Also going to select variables for our research.

This command loads our data

```{r}
load("~/Data/addhealth4.RData")
```
This command names our data

```{r}
ls()
```
now we will load our packages so that we can use commands.

```{r, warning=FALSE}
library(dplyr)
library(janitor)
load("~/Data/addhealth4.RData")
```

selection of Variables
1. H4ED1 what is your high school graduation status?
  - Categorical Variable





```{r, message=FALSE}
mydata <- addhealth4 %>%
    select (H4ED1, H4ED2,H4EC2,H4ED4A)
````


next I will be cleaning the variables.


```{r, warning=FALSE}
clean <- mydata %>%
    mutate(new_H4ED1 = recode(H4ED1,
                              "1" = "finished high school with diploma",
                              "2" = "earned a high school degree (GED)",
                              "3" = "earned a certificate of attendance or a certificate of completion",
                              "4" = "did not receive a high school diploma, equivalency degree (GED), or other                                               certificate",
                              "8" = "don’t know"))%>%
    mutate(new_H4ED2 = recode(H4ED2,
                              "1" = "8th grade less",
	                          "2" = "Some high school",
	                          "3" = "highschool graduate",
                              "4" = "some vocational/technical training (after Highschool)",
                              "5" = "completed vocational/technical training (after highschool)",
	                          "6" = "some college",
	                          "7" = "completed college bachelors degree",
	                          "8" = "some graduate school",
	                          "9" = "completed masters degree",
                              "10" = "some graduate training",
	                          "11" = "completed doctoral degree",
	                          "12" = "some post baccalaureate professional education"))

```




```{r}
save(clean, file="~/Data/first_project.RData")
```


