library(readxl)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.6
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ ggplot2 4.0.1 ✔ tibble 3.3.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.2
## ✔ purrr 1.2.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
setwd("~/PAD 6833/Research Data Selection")
Border_kids<-read_excel("Border_kids.xlsx")
# 1) summary(data$x)
summary(Border_kids$`Children in CBP custody`)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 7.0 26.0 54.0 148.9 261.0 531.0 701
#2) hist(data$x) - for continuous variables
hist(Border_kids$`Children in CBP custody`)

#3) plot(data$x,data$y) - to compare variables
plot(Border_kids$`Children in CBP custody`, Border_kids$`Children in HHS Care`)

#4) cor(data$x,data$y) - to see a correlation between two variables
Border_kids<-Border_kids %>% drop_na()
cor(Border_kids$`Children in CBP custody`,Border_kids$`Children in HHS Care`)
## [1] 0.9312843
#This is a strong positive correlation