代写ECON 2041 Problem set调试Python程序

ECON 2041 Problem set

Objectives

Demonstrate your mastery of topics covered in ECON2041 so far, including multivariate regression, statistical inference, and model diagnostics.

Practice producing a professional memo that applies econometric techniques to a business problem and communicates the results to a non-technical audience.

Employers (whether in government, consulting, finance, or research) value graduates who can turn careful analysis into clear, non-technical language that supports decision-making. This assessment is designed to give you practice with this highly sought-after skill, which is often tested in job applications and interviews for junior roles.

Introduction

Insurance companies face uncertainty in predicting how much different customers will cost them. You will use a dataset of 1,338 insured individuals that includes demographics (age, sex, number of children), health behaviors (smoking status), body composition (BMI), geographic region, and annual medical charges billed to the insurance system. These charges effectively represent what the insured individual cost the insurance company in the previous year.

Your objective is to analyze which observable characteristics drive differences in annual medical costs and communicate your findings in a memo for an insurance company's research division.

Deliverables

1. Analysis notebook (60 marks)

The analysis notebook ( .ipynb ) should contain all of the technical Python work that underpins the memo, following the technical requirements below.

The notebook should be clear, reproducible, and fully commented. Include the sections as described below. The notebook should be possible to run from start to finish without errors and must reproduce the results you report in the memo.

(A) Exploratory data analysis (EDA) [15 marks]

Complete the following EDA tasks:

1. Summary statistics

Create a summary statistics table for  charges ,  age ,  bmi , and  children

Create a frequency table for  smoker ,  region , and  sex

2. Distribution of the dependent variable Create a histogram of charges

3. Smokers vs. non-smokers

Calculate and report the mean and standard deviation of  charges  for smokers and non-smokers

4. Joint relationships

Create a scatterplot of  charges  vs  age

Create a scatterplot of  charges  vs  bmi

Create a scatterplot, grouped by  smoker  status: create another scatterplot, with points marked different colors by smoker status (Hint: Remember that we use the option  hue  to apply different colors to different groups)

(B) Model estimation [20 marks]

1. Model 1: Baseline

Estimate a simple regression using OLS, with  charges  as the dependent variable and  smoker  as the independent variable. This is your baseline model.

2. Model 2: Binary BMI

Create a binary variable for BMI > 30 ( obese ). Estimate an OLS model with  charges  as the dependent variable. Explanatory variables:  smoker ,  obese , plus the demographic variables ( age ,  sex ,  children ) and geographical variable ( region ). Make sure that your regression specification accounts for the fact that  region   is categorical.

3. Model 3: Your preferred model

Estimate an OLS model, with all the same explanatory variables as Model 2, plus you must include the interaction between  smoker  and  obese

you may include non-linear transformations of  age , such as  age 2 and  age 3 , depending on the results of the relevant hypothesis test (see below)

you may include the interaction between age and smoker, depending on the results of the relevant hypothesis test (see below)

Remember: if you include an interaction term between two variables xj and xk, you always have to include the variables themselves as well

Include all the regressions you try in the notebook, even though you will only report your final regression in the memo

Clearly identify in the notebook which is your preferred regression (based on the hypothesis tests)

(C) Diagnostic tests [10 marks]

1. Conduct a Breusch-Pagan test for heteroskedasticity on all three models (Baseline, Model 2, Preferred model)

2. If any regression shows evidence of heteroskedasticity at α = 0.1, then re-estimate the model using robust standard errors

include the robust-standard error results in your memo

conduct the hypothesis tests below with robust standard errors

Note: you may have to iterate a bit back and forth between (C) and (D), as you use the findings from the F-tests to choose your preferred model.

(D) Hypothesis tests [15 marks]

1. t-tests:

1. Test whether smoking significantly affects medical costs in Model 1

2. Test whether the difference in costs between smokers and non-smokers differs significantly between obese and non-obese individuals in your preferred model

2. F-tests:

1. Test whether the demographic variables ( age ,  children ,  sex ) and  region  are jointly significant using an F-test in Model 2

2. Test whether  age  has a non-linear relationship with  charges   by comparing Model 2 to a regression that also includes age2 and age3 . Test their joint significance using an F-test

For each test, state the null and alternative hypotheses in your notebook and report the test statistic & p-value

(E) Save your results

1. Save your regression output in an Excel file (instructions in the notebook) for easy copying into a Word table

2. As always, save your  .ipynb  file after running everything and include this with your submission

2. Research memo, max 3 pages (40 marks)

Written for a well-informed, non-econometrician audience, the memo should be concise, focused, and free of econometric jargon. You should write in complete sentences and paragraphs, not bullet points.

Please view the memo template for the recommended structure!

.  The memo must include exactly one figure and one regression table:

. The figure should illustrate your most important finding (e.g., the relationship between a key predictor and medical costs).

The table should report the results from 3 different regression models. For each, it should report the

estimated coefficients, the appropriate standard errors (i.e. robust if there is heteroskedasticity), observation numbers, and R2 values. Format the table clearly and report an appropriate number of decimal places.

1. The first column should report the results from the baseline model.

2. The second column should report results from Model 2.

3. The last column of the table should report the results from your preferred model.

Memo marking criteria

Technical accuracy (15 marks): Correct interpretation of coefficients, standard errors and confidence intervals, and model fit statistics

Business communication (10 marks): Presents findings in clear, jargon-free language that a non- econometrician can understand, while maintaining a professional tone and style.

Critical analysis (5 marks): promCareful discussion of limitations and realistic recommendations

Professional presentation (10 marks): The memo includes one clear figure with appropriate labels and one well- formatted regression table, uses consistent and appropriate formatting (e.g., not too many significant digits), and   respects the page limit. This component also covers compliance with the assessment's genAI policy.




热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图