Issue the data(state) command to load the sample state data objects. We will work with the matrix
state.x77 which is one of the state sample data sets
a) Look up the help for state.x77.
b) Display the dimension names of the state.x77 matrix.
c) Write an expression that returns the summary statistics, as given by summary(), for each of the
columns in this matrix.
d) Create a vector named popdense that contains the population density in persons per square mile. Note
that the population in state.x77 is given in thousands.
e) Apply the pairs() function to the matrix to create scatter plots of all columns against one another.
f) When passed a matrix, the cor() function creates a correlation matrix where the value in the ith row
and the jth column is the correlation between the ith and jth columns of the original matrix. Use cor() to
create a correlation matrix named cor.state.x77.
g) The var() function is similar to the cor() function except that it creates a covariance matrix rather
than a correlation matrix. The diagonal elements are variances and the off diagonal elements are
covariances. Use the var() function to overwrite the elements on the diagonal of cor.state.x77
with variances and elements on the upper diagonal with covariances. Elements on the lower diagonal
will remain correlations.
h) Display the contents of the matrix sorted by descending Murder rates.
i) Select the states that have <1% illiteracy, but a murder rate of > 10 per 100, 000.
j) Select the states that have greater than average high school graduate rates, but less than average
annual income.