Module #3 Assignment

 9/11/2023


This week I am analyzing two sets of data:

Set#1:  10, 2, 3, 2, 4, 2, 5
Set#2:  20, 12, 13, 12, 14, 12, 15

Set #1:

x <- c(10, 2, 3, 2, 4, 2, 5)

mean(x) : 4

median(x) : 3

For the mode I had to do some research, but ended up with this: 

freq_table <- table(x)

mode_values <- as.numeric(names(freq_table[freq_table == max(freq_table)]))

cat("Mode(s):", mode_values, "\n")

The result : 2

range(x) : 8

IQR(x) : 2.5

var(x) : 8.33

sd(x) : 2.89


Set #2:

y <- c(20, 12, 13, 12, 14, 12, 15)


mean(y) : 14

median(y) : 13

freq_tables <- table(y)

mode_value <- as.numeric(names(freq_table[freq_table == max(freq_table)]))

cat("Mode(s):", mode_values, "\n")

result : 12

range(y) : 8 

IQR(y) : 2.5

var(y) : 8.33

sd(y) :2.89


-It's interesting to me that the data sets share the same range, IQR, variance and standard deviation according to my results. This must mean they have similar variability. 


Comments

Popular posts from this blog

Module #11 Assignment

Module #12 Assignment

Module #9 Assignment