﻿ Statistics 506代写 Problem Set代写 - 作业代写, 金融经济统计代写

# Statistics 506代写 Problem Set代写

2021-06-10 17:45 星期四 所属： 作业代写 浏览：97

## Due:MondayNovember16,by7pm

Statistics 506代写 Submit the assignment by the due date via Canvas. Assignments may be submitted up to 72 hours late for a 5 point reduction.

### Instructions

Submit the assignment by the due date via Canvas. Assignments may be submitted up to 72 hours late for a 5 point reduction.

All ﬁles read, sourced, or referred to within scripts should be assumed to be in the same working directory ( ./ ).

Your code should be clearly written and it should be possible to assess it by reading it. Use appropriate variable names and comments. Your style will be graded using the style rubric (./style_guide.html) [15 points].

Some of these exercises may require you to use commands or techniques that were not covered in class or in the course notes. You can use the web as needed to identify appropriate approaches. Part of the purpose of these exercises is for you to learn to be resourceful and self suﬃcient. Questions are welcome at all times, but please make an attempt to locate relevant information yourself ﬁrst.

Please use the provided templates (https://github.com/jbhender/Stats506_F20/tree/master/problem_sets/templates/).

This assignment should be done primarily in SAS, with the exception that the write up and any associated ﬁgures or tables may be produced in R. As always you may use the Linux shell for data preparation and download documentation.

Your submission should include a write-up as a pdf or HTML document and all scripts needed to reproduce it. In your document, describe how the ﬁles submitted relate to one another and be sure to answer the questions.

For this assignment, scripts you should submit are: SAS ( .sas ), Rmarkdown ( .Rmd or .R with spin) for the write-up, the write up itself ( .pdf or .html ), and (optionally) a shell script ( .sh ) ps4_make.sh to build the assignment.

### Question 1 [60 points]

This question is a modiﬁed version of question 1 from problem set 2. It is worth fewer points because the grouping structure is simpliﬁed and you should be able to adapt code for creating ﬁgures and tables from the earlier assignment.

Use the 2009 and 2015 Residential Energy Consumption Survey RECS (https://www.eia.gov/consumption/residential/) data to proﬁle the quantities and types of televisions in US homes, by Census Region.

#### a.[30points]

Compare the average number of televisions ( TVCOLOR ) in US homes in 2009 and 2015 by Census Region.

i. Compute point estimates and 95% conﬁdence intervals for both years (in SAS)and produce a ﬁgure (in R) to display the results.

ii. Compute point estimates and 95% conﬁdence intervals for the 2015 less 2009 differences(in SAS) and produce a ﬁgure (in R) to display the results.

iii. Combine the estimates for 2009, 2015, and their difference into a nicely formatted table.

#### b. [30 points]

Repeat part “a” for the proportion of primary televisions by display typefor most used television ( TVTYPE1 ).

### Question 2 [25 points]  Statistics 506代写

In this question you will use the NHANES data dentition and demographics data from PS3.

a. [10 points] Pick a single tooth ( OHXxxTC ) and model the probability that a permanent tooth is present as a function of age using logistic regression. For this part (“a”), assume the data are iid and ignore the survey weights. You should consider non-linear transforms of age but only need to document your ﬁnal model in the write up. Control for other demographics included in the data as warranted.

b.[10points] Reﬁt your model from part a using proc surveylogistic to account for the weights. See the notes below for links to example code.

c. [5points] In your write up, provide a side-by-side comparison of the results when using or ignoring the survey weights. This could be either a ﬁgure or a table (one will suﬃce).

### Notes:  Statistics 506代写

• The data are available in the Stats506_F20 repository under problem_sets/data/ . You will need the following two ﬁles:

△ nahanes_demo.csv

△ nhanes_ohxden.csv

• The ﬁrst link below has a number of tutorials on working with survey weights from NHANES. The second link is speciﬁc to SAS and logistic regression.

△  https://wwwn.cdc.gov/nchs/nhanes/tutorials/samplecode.aspx (https://wwwn.cdc.gov/nchs/nhanes/tutorials/samplecode.aspx)

△https://wwwn.cdc.gov/nchs/data/tutorials/LogisticRegression_SAS_update_92.sas (https://wwwn.cdc.gov/nchs/data/tutorials/LogisticRegression_SAS_update_92.sas)

• Note, because we are using the dentition exam data use the mec weights included in the data from the course repo.