R Markdown

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
data("starwars")

##Question 1 There are 87 rows and 14 variables.

##Question 2 There are three numerical variables, height, mass, and birth year. There are three categorical variables, hair color, skin color, and eye colored. The catergorical variables are unordered and not binary.

summary(starwars$height)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.     NAs 
##    66.0   167.0   180.0   174.6   191.0   264.0       6

##Question 3 There are six characthers with unkown heights.

summary(starwars$mass)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.     NAs 
##   15.00   55.60   79.00   97.31   84.50 1358.00      28

##Question 4 There are 28 characthers with an unkown mass.

##Question 5 Using the summary output of height, the measures of center are Median = 18.0 and Mean = 174.6.

##Question 6

hist( starwars$height,  col = "gold", xlab = "Height of characters (in centimeters)" )

##Question 7 The distribution of heights is unimodal.

##Question 8 The distribution of heights is right skewed because most of the data is around 150-200 cm.

##Question 9 The best measure of center is the median because its right skewed and has an outlier.

##Question 10

boxplot(starwars$height, col = "blue", xlab = "Height of characters (in centimeters)", horizontal = TRUE)

##Question 11 The best measure of center is Median because it won’t be as affected by the outliers.

##Question 12 There are several outliers on each side and they are both abnormally small and abnormally large.

##Question 13

boxplot(starwars$mass, col = "red", xlab = "Mass of characters (in kilograms)
", horizontal = TRUE)

##Question 14 Jabba Desilijic Tiure has the largest body mass making it the outlier.

##Question 15 The IQR for height is 24.

##Question 16 The Histogram shows the shape of distribution which includes modality and boxplot shows the median and potential outliers.