R program questions

QUESTION

Problem #1. (15 pts)

Use the “College” data set from the package “ISLR”, do the following:

  1. Get familiar with the data set. How many variables the data set has? What is the class of the variable “Private”? (3 pt)
  2. Add a new column “Enroll.rate” which is the ratio of Enroll v.s. Accept, to the data set. (4 pts)
  3. What are the top 10 Universities in terms of “Enroll.rate” (highest student enrollment ratio)? (4 pts)
  4. Get a new data frame “Mysubset” with all rows with an “Outstate” fee between 8000-9000 USD. (4 pts)

Problem #2. (12 pts)

Download and import the csv file “R_Data_Hack_Problem2” from Canvas under Module R Data Hack and rename it as “testdata”. Can you reject the hypothesis that the mean of “Fertility Rate” in 2013 is greater than in 1960 based on 99% confidence interval? Explain your rationale. (6 pts) Is it appropriate to use t test for this problem and why? (2 pts) Can you assume equal variance for the two groups? (2 pts) Clearly state your H0 and H1. (2 pt)

Problem #3. (18 pts)

Use set.seed(194) to generate the data set mydata = rep(sin(seq(0,10,length.out = 25)),4) + rnorm(25*4), and do the following:

1. Create ‘myts’ which is a monthly time series of ‘mydata’, starting from June of 2014. (3 pts)
2. Plot the data, and explain the statistical characters of the data. (2 pts)
3. Use 80% of the data as the training set and the rest as the test set. (3 pts)
4. Set up two forecasting models using the Average method and the Drift method with the training set. (2 pts)
5. Get a plot with the two forecasts of the models, and add a legend. (2 pts)

6. Get the error measures of the two forecast methods and compare them in terms of the training set and test set; Which method looks more promising? Explain your rationale. (6 pts)

Get your college paper done by experts

Do my question How much will it cost?

Place an order in 3 easy steps. Takes less than 5 mins.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *