linkedin <- c(16, 9, 13, 5, 2, 17, 14)
facebook <- c(17, 7, 5, 16, 8, 13, 14)
what would be the output of: avg_sum_trimmed <- mean(linkedin + facebook, trim = 0.2)
which values are not included?
linkedin <- c(16, 9, 13, 5, 2, 17, 14)
facebook <- c(17, 7, 5, 16, 8, 13, 14)
sum_values <- linkedin + facebook
# sum_values = c(33, 16, 18, 21, 10, 30, 28)
avg_sum_trimmed <- mean(sum_values, trim = 0.2)
avg_sum_trimmed
Now, let's identify the values that are not included in the calculation of avg_sum_trimmed. To do that, we need to determine the proportion of values to be trimmed from both ends. Since trim = 0.2, we will remove 20% of the values from the dataset.
Given the sum_values vector: c(33, 16, 18, 21, 10, 30, 28)
We will trim 20% of the values, which means removing 20% of 7, resulting in 1.4 values. Since we cannot remove fractional values, we will remove 1 value from each end.
The values that are not included in the calculation of avg_sum_trimmed are:
The largest value: 33 (removed from the upper end) The smallest value: 10 (removed from the lower end) Therefore, the remaining values that are included in the calculation of avg_sum_trimmed are: 16, 18, 21, 30, and 28.
The output of avg_sum_trimmed will be the trimmed mean of these values.