modifiedMortar <- c(16.85, 16.40, 17.21, 16.35, 16.52, 17.04, 16.96, 17.15, 16.59, 16.57)
unmodifiedMortar <- c(16.62, 16.75, 17.37, 17.12, 16.98, 16.87, 17.34, 17.02, 17.08, 17.27)
mMean <- mean(modifiedMortar)
uMean <- mean(unmodifiedMortar)
mMedian <- median(modifiedMortar)
uMedian <- median(unmodifiedMortar)
Modified Mortar Mean: 16.764
Unmodified Mortar Mean: 17.042
Modified Mortar Median: 16.72
Unmodified Mortar Median: 17.05
and IQR of each dataset.
mSd <- sd(modifiedMortar)
uSd <- sd(unmodifiedMortar)
mVar <- var(modifiedMortar)
uVar <- var(unmodifiedMortar)
mIQR <- IQR(modifiedMortar)
uIQR <- IQR(unmodifiedMortar)
Modified Mortar Standard Deviation: 0.3164455
Unmodified Mortar Standard Deviation: 0.2479158
Modified Mortar Variance: 0.1001378
Unmodified Mortar Variance: 0.0614622
Modified Mortar IQR: 0.4875
Unmodified Mortar IQR: 0.335
hist(modifiedMortar)
The histogram is skewed to the left which visually displays that the mean is greater than the median.
hist(unmodifiedMortar)
The histogram is skewed to the right which visually displays that the mean is less than the median.
boxplot(modifiedMortar, unmodifiedMortar)
Tension bond strength is seen to generally be higher than those in the
unmodified mortar.
coursesPerStudent <- c(4,2,3,3,1,5,4,2,2,4,5,6,4,3,3,4,4,5,6,1,2,2,3,4,3,3,5,2,1,3)
table(coursesPerStudent)
## coursesPerStudent
## 1 2 3 4 5 6
## 3 6 8 7 4 2
pie(coursesPerStudent, col = c("lightblue", "lightgreen", "lightcoral", "lightyellow"), main="Pie Chart: Course Distribution per Student")
barplot(coursesPerStudent, col = c("lightblue", "lightgreen", "lightcoral", "lightyellow"), main="Bar-Plot: Course Distribution per Student")
studentsMoreThanFour <- 0;
for (i in coursesPerStudent){
if (i > 4){
studentsMoreThanFour <- studentsMoreThanFour + 1
}
}
Total number of students taking more than 4 courses: 6
sequence <- seq(2,50, by = 2)
2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50
sequence <- log(sequence)
0.6931472, 1.3862944, 1.7917595, 2.0794415, 2.3025851, 2.4849066, 2.6390573, 2.7725887, 2.8903718, 2.9957323, 3.0910425, 3.1780538, 3.2580965, 3.3322045, 3.4011974, 3.4657359, 3.5263605, 3.5835189, 3.6375862, 3.6888795, 3.7376696, 3.7841896, 3.8286414, 3.871201, 3.912023
sequence <- sequence[-(3:10)]
0.6931472, 1.3862944, 3.0910425, 3.1780538, 3.2580965, 3.3322045, 3.4011974, 3.4657359, 3.5263605, 3.5835189, 3.6375862, 3.6888795, 3.7376696, 3.7841896, 3.8286414, 3.871201, 3.912023 ## (d) Use length() to obtain the length of the resulting sequence in (c).
length <- length(sequence)
17
sort(sequence)
## [1] 0.6931472 1.3862944 3.0910425 3.1780538 3.2580965 3.3322045 3.4011974
## [8] 3.4657359 3.5263605 3.5835189 3.6375862 3.6888795 3.7376696 3.7841896
## [15] 3.8286414 3.8712010 3.9120230
0.6931472, 1.3862944, 3.0910425, 3.1780538, 3.2580965, 3.3322045, 3.4011974, 3.4657359, 3.5263605, 3.5835189, 3.6375862, 3.6888795, 3.7376696, 3.7841896, 3.8286414, 3.871201, 3.912023