R program questions
Problem #1. (15 pts)
Use the “College” data set from the package “ISLR”, do the following:
- Get familiar with the data set. How many variables the data set has? What is the class of the variable “Private”? (3 pt)
- Add a new column “Enroll.rate” which is the ratio of Enroll v.s. Accept, to the data set. (4 pts)
- What are the top 10 Universities in terms of “Enroll.rate” (highest student enrollment ratio)? (4 pts)
- 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)
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.