Aircraft Data
Description
Aircraft Data, deals with 23 single-engine aircraft built over the years 1947-1979, from Office of Naval Research. The dependent variable is cost (in units of $100,000) and the explanatory variables are aspect ratio, lift-to-drag ratio, weight of plane (in pounds) and maximal thrust.
required packages
require(ggplot2)
## Loading required package: ggplot2
library(ggplot2)
require(RCurl)
## Loading required package: RCurl
## Loading required package: bitops
library(RCurl)
pulling data
url <- getURL("https://raw.githubusercontent.com/choudhury1023/CUNY-MSDA-Bridge-Workshop-R/master/aircraft.csv")
aircraft <- read.csv(text = url)
aircraft <- aircraft[,c(2:6)]
rename columns
names(aircraft) <- c("aspect_ratio", "lift_to_drag_ratio", "weight", "maximal_thrust","cost")
head(aircraft)
## aspect_ratio lift_to_drag_ratio weight maximal_thrust cost
## 1 6.3 1.7 8176 4500 2.76
## 2 6.0 1.9 6699 3120 4.76
## 3 5.9 1.5 9663 6300 8.75
## 4 3.0 1.2 12837 9800 7.78
## 5 5.0 1.8 10205 4900 6.18
## 6 6.3 2.0 14890 6500 9.50
Generate summary level descriptive statistics
summary(aircraft)
## aspect_ratio lift_to_drag_ratio weight maximal_thrust
## Min. :1.600 Min. :1.20 Min. : 6699 Min. : 3120
## 1st Qu.:2.850 1st Qu.:1.75 1st Qu.:12232 1st Qu.: 7980
## Median :3.900 Median :2.30 Median :14890 Median :14500
## Mean :3.909 Mean :2.80 Mean :18092 Mean :15913
## 3rd Qu.:4.750 3rd Qu.:3.50 3rd Qu.:22645 3rd Qu.:22050
## Max. :6.300 Max. :9.70 Max. :46172 Max. :37000
## cost
## Min. : 2.760
## 1st Qu.: 8.265
## Median : 13.590
## Mean : 20.327
## 3rd Qu.: 27.160
## Max. :107.100
R graphics
Histogram for Aspect Ratio
qplot(aspect_ratio, data = aircraft, geom="histogram", ,binwidth = 0.5,main = "Histogram for Aspect Ratio", xlab = "Aspect Ratio", fill=I("blue"), col=I("black"), xlim=c(1, 7))

Histogram for Lift to Drag Ratio
qplot(lift_to_drag_ratio, data = aircraft, geom="histogram", ,binwidth = 0.5,main = "Histogram for Lift to Darg Ratio", xlab = "Lift to Drag Ratio", fill=I("green"), col=I("black"), xlim=c(1, 10))

Boxplot for Cost
ggplot(aircraft, aes(y = cost, x = 1)) + geom_boxplot(fill = "yellow")

Scatter plot for Weight and Maximal Thrust
ggplot(aircraft, aes(weight, maximal_thrust))+ geom_point(aes(colour = I("red")))

#A relationship is visible, havier aircrafts are likely to have more thrust