Question: THIS question is or economic stats R CODE ---- PLEASE HELP RCODE USING RSTUDIO Charges,Age,BMI,Female,Children,Smoker,WinterSprings,WinterPark,Oviedo 1639.5631,19,30.59,0,0,0,0,0,0 21232.18226,48,29.6,0,0,0,0,0,1 6250.435,43,23.2,0,0,0,0,0,1 38282.7495,33,35.75,0,1,1,0,1,0 4337.7352,28,28.88,1,1,0,1,0,0 8968.33,48,30.2,0,2,0,0,0,1 12797.20962,44,36.48,1,0,0,1,0,0 1984.4533,20,40.47,0,0,0,1,0,0 17878.90068,25,41.325,1,0,0,1,0,0

THIS question is or economic stats "R CODE " ---- PLEASE HELP RCODE USING RSTUDIO

"Charges","Age","BMI","Female","Children","Smoker","WinterSprings","WinterPark","Oviedo" 1639.5631,19,30.59,0,0,0,0,0,0 21232.18226,48,29.6,0,0,0,0,0,1 6250.435,43,23.2,0,0,0,0,0,1 38282.7495,33,35.75,0,1,1,0,1,0 4337.7352,28,28.88,1,1,0,1,0,0 8968.33,48,30.2,0,2,0,0,0,1 12797.20962,44,36.48,1,0,0,1,0,0 1984.4533,20,40.47,0,0,0,1,0,0 17878.90068,25,41.325,1,0,0,1,0,0 8930.93455,47,29.545,1,1,0,0,0,0 9991.03765,52,18.335,1,0,0,0,0,0 4527.18295,30,28.405,1,1,0,0,0,0 15555.18875,63,41.325,0,3,0,0,0,0 2690.1138,23,28.12,1,0,0,0,0,0 20462.99766,53,38.06,1,3,0,0,1,0 2639.0429,22,28.31,0,1,0,0,0,0 7358.17565,41,31.635,1,1,0,1,0,0 6457.8434,38,29.26,0,2,0,0,0,0 11381.3254,58,49.06,0,0,0,0,1,0 28340.18885,45,27.645,1,1,0,0,0,0 21098.55405,45,22.895,0,2,1,0,0,0 38344.566,20,39.4,0,2,1,0,0,1 2866.091,29,27.2,0,0,0,0,0,1 13063.883,61,44,1,0,0,0,0,1 11735.87905,58,28.595,0,0,0,0,0,0 1981.5819,24,32.01,0,0,0,0,1,0 5031.26955,31,27.645,0,2,0,1,0,0 9447.25035,48,27.265,1,1,0,1,0,0 17560.37975,20,28.025,0,1,1,0,0,0 6238.298,39,32.5,1,1,0,0,0,1 47403.88,61,36.3,0,1,1,0,0,1 11356.6609,57,34.01,0,0,0,0,0,0 9724.53,52,30.2,0,1,0,0,0,1 3579.8287,21,33.63,1,2,0,0,0,0 6653.7886,33,33.44,0,5,0,0,1,0 5472.449,36,25.9,1,1,0,0,0,1 7147.4728,44,34.32,0,1,0,0,1,0 7640.3092,42,29.48,1,2,0,0,1,0 20709.02034,57,40.28,0,0,0,1,0,0 40974.1649,48,33.11,1,0,1,0,1,0 7371.772,41,37.1,1,2,0,0,0,1 17496.306,32,24.6,1,0,1,0,0,1 8027.968,45,28.7,0,2,0,0,0,1 28287.89766,59,36.52,1,1,0,0,1,0 40273.6455,41,35.75,0,1,1,0,1,0 5846.9176,35,43.34,1,2,0,0,1,0 12982.8747,62,39.93,0,0,0,0,1,0 9222.4026,41,29.64,0,5,0,1,0,0 6610.1097,40,41.23,0,1,0,1,0,0 6710.1919,39,24.51,0,2,0,0,0,0 --- title: "Coding Assignment 3" author: "Team N" date: "Due: 2021-12-09 23:59" output: html_document: toc: true toc_float: true --- ```{r setup, include=FALSE} #Put any packages you need here knitr::opts_chunk$set(echo = TRUE) ``` A Florida health insurance company wants to predict annual claims for individual clients. The company pulls a random sample of 50 customers. The owner wishes to charge an actuarially fair premium to ensure a normal rate of return. The owner collects all of their current customers health care expenses from the last year and compares them with what is known about each customers plan. The data on the 50 customers in the sample is as follows: - Charges: Total medical expenses for a particular insurance plan (in dollars) - Age: Age of the primary beneficiary - BMI: Primary beneficiarys body mass index (kg/m2) - Female: Primary beneficiarys birth sex (0 = Male, 1 = Female) - Children: Number of children covered by health insurance plan (includes other dependents as well) - Smoker: Indicator if primary beneficiary is a smoker (0 = non-smoker, 1 = smoker) - Cities: Dummy variables for each city with the default being Sanford Answer the following questions using complete sentences and attach all output, plots, etc. within this report. ```{r dataset, include=FALSE} # Bring in the dataset here. ``` ## Question 1 Randomly select three observations from the sample and exclude from all modeling (i.e. n=47). Provide the summary statistics (min, max, std, mean, median) of the quantitative variables for the 47 observations. ```{r q1} ``` ## Question 2 Provide the correlation between all quantitative variables ```{r} ``` ## Question 3 Run a regression that includes all independent variables in the data table. Does the model above violate any of the Gauss-Markov assumptions? If so, what are they and what is the solution for correcting? ## Question 4 Implement the solutions from question 3, such as data transformation, along with any other changes you wish. Use the sample data and run a new regression. How have the fit measures changed? How have the signs and significance of the coefficients changed? ```{r q3} ``` ## Question 5 Use the 3 withheld observations and calculate the performance measures for your best two models. Which is the better model? (remember that "better" depends on whether your outlook is short or long run) ```{r q4} ``` ## Question 6 Provide interpretations of the coefficients, do the signs make sense? Perform marginal change analysis (thing 2) on the independent variables. ```{r} ``` ## Question 7 An eager insurance representative comes back with five potential clients. Using the better of the two models selected above, provide the prediction intervals for the five potential clients using the information provided by the insurance rep. | Customer | Age | BMI | Female | Children | Smoker | City | | -------- | --- | --- | ------ | -------- | ------ | -------------- | | 1 | 60 | 22 | 1 | 0 | 0 | Oviedo | | 2 | 40 | 30 | 0 | 1 | 0 | Sanford | | 3 | 25 | 25 | 0 | 0 | 1 | Winter Park | | 4 | 33 | 35 | 1 | 2 | 0 | Winter Springs | | 5 | 45 | 27 | 1 | 3 | 0 | Oviedo | ```{r} ``` ## Question 8 The owner notices that some of the predictions are wider than others, explain why. ## Question 9 Are there any prediction problems that occur with the five potential clients? If so, explain.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!