************* Use R

  1. For the following question, you will use the Beer Preference data used in class. You are asked to replicate some results and do some further analysis. The data can be found on the course website. (You do not need to partition the data).
    1. Fit a linear probability model for Preference as a function of all other variables. Use Preference = Light as the success class (i.e. Light should have the higher level as a factor).
    2. Generate predicted preferences using a cutoff of 0.5.
    3. What is the total error rate (i.e. the proportion of misclassified points)?
    4. What is the error rate for each class – i.e. the proportion of each class that is misclassified?
    5. Create a chart as follows: sort the data by predicted probability of liking light beer (in descending order); create the cumulative of actual preference and plot (against rank). So, for instance, the first point would be (1, 1) if the person most likely to like light beer according to your model actually liked light beer; the second point would be (2, 2) if the second most likely person also actually liked light beer, but (2, 1) if he liked regular beer, and so on. Extend the above plot to include (0, 0) and connect with a straight line (using the R lines(…) function); for reference, graph a line joining (0, 0) to the last point (i.e. the cumulative after the full sample has been accounted for).
    6. What would this chart ideally look like? I.e. if you had a perfect classifier, what would the chart look like?
  2. Repeat (2) above for the for the logistic regression model. Which is the better model?

*********** Note: you have to use Package rattle

Looking for solution of this Assignment?

WHY CHOOSE US?

We deliver quality original papers

Our experts write quality original papers using academic databases.We dont use AI in our work. We refund your money if AI is detected  

Free revisions

We offer our clients multiple free revisions just to ensure you get what you want.

Discounted prices

All our prices are discounted which makes it affordable to you. Use code FIRST15 to get your discount

100% originality

We deliver papers that are written from scratch to deliver 100% originality. Our papers are free from plagiarism and NO similarity.We have ZERO TOLERANCE TO USE OF AI

On-time delivery

We will deliver your paper on time even on short notice or  short deadline, overnight essay or even an urgent essay