机器学习 R语言代写 Econ 3818

Econ 3818 Fall 2018
R exercise 1

Due September 4th 5pm via Desire to Learn Dropbox as a pdf file.

  • Write up your answers and paste the R code used in a word document.
  • Separate the R code above and below by three asterisk (***).
  • Copy and paste all plots generated into the word document.
  • Saved the document as a pdf and submit it via Desire to Learn.

    You may work in groups of three (but no more than three!). Please put the name of all group members at the top of the text file.

  1. Go through introduction_to_R.pdf. Install R and R studio. In the context of the introduction_to_R.pdf, what is the value of nonsense?
  2. Load the dataset on household and neighbor characteristics found at

    https://mattbutner.github.io/data/housing_df.csv

    as done in the introduction_to_R.pdf document.
    Look in the upper right panel of R studio, how many variables and how many observations are in this data set?

  3. The variable descriptions for this dataset can be found at the following url

    http://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.names

    Which of the variables are quantitative, which of the variables are categorical?

  4. Use the function mean() to find the average median value of owner-occupied homes in $1000’s.

    Report the R code and number to two digits.

  5. Use the function sd() to calculate the sample standard deviation median value of owner- occupied homes in $1000’s.
    Report the R code and number to two digits.
  6. Using the functions sqrt(), sum(), ^2, length(), and mean(), but not var() or sd(), calculate the sample standard deviation median value of owner-occupied homes in $1000’s. Report the R code and number to two digits.
  7. Use the hist() function, create a histogram of NOX pollution. With this distribution is the mean or median a better measure of central tendency?