Instructions: Attempt all the questions.

Question 1:

Suppose we are given the following data set

age = c(22, 17, 15, 19, 16, 15, 23, 76)
# When we run the print command print, the outputs are as follows
print(age)
## [1] 22 17 15 19 16 15 23 76

Now, do the following questions hereunder:

    1. If our interest is to remove the entire data set called age, what R code can we write to perform this operation?
    1. If our interest again centres on removing 23, write an R command to do so.
    1. Write syntactically correct R code to remove 17, 19 and 76 respectively.
    1. Write R codes to perform the following operations:
  1. average age

  2. median age

  3. variance of the age

  4. semi-interquartile range

  5. mean absolute deviation

  6. minimum age value

  7. maximum age value

Question 2:

Given the following commands:

age2 = c(22, 25, 28, 31, 34, 37, 40, 43, 46, 49)
print(age2)
##  [1] 22 25 28 31 34 37 40 43 46 49

-(a) Write R commands to generate age2.

-(b) Write a code to select only the first four numbers from age2.

Best wishes…