Homework 6 Answers

Due 11/17/24

Author

Nicky Wakim

Modified

November 6, 2024

Warning

To see my math equations properly, you need to download the html file, then open it! One Drive does not show the math correctly!!

Book exercises

4.4 Mental health, Part I

The 2010 General Social Survey asked the question: “For how many days during the past 30 days was your mental health, which includes stress, depression, and problems with emotions, not good?” Based on responses from 1,151 US residents, the survey reported a 95% confidence interval of 3.40 to 4.24 days in 2010.

(a)

(b)

(c)

larger

4.6 Thanksgiving spending, Part I

(a)

False

(b)

False

(c)

False

(d)

True

(e)

True

(f)

True

4.8 Age at first marriage, Part I

95% CI: 23.32, 23.56

5.6 Working backwards, Part II

  • \(\bar{x}= 71\)
  • margin of error is 6
  • sample standard deviation is 17.535

5.12 Auto exhaust and lead exposure

(a)

\[\begin{align} &H_0: \mu = 35\\ &H_A: \mu > 35 \end{align}\]

(b)

  • Independence
  • Sample size \(n=52\) is greater than 30

(c)

  • \(t_{\overline{x}} = 17.06666\)
  • \(p-value = 4.956975\cdot 10^{-23}\)

(d)

Not contain 35

(e)

Not contain 0

1 R exercises

1.1 Load all the packages you need below here

1.2 R1: Are American adults getting enough sleep?

1.2.1 Explore the distribution of in nhanes.samp.adult

Part a

Using numerical and graphical summaries, describe the distribution of nightly sleep hours in nhanes.samp.adult.

The data are roughly symmetric around the mean at 6.9 hours. There is one very low outlier corresponding to one person who reported getting 2 hours of sleep on weekdays. The middle half of participants report getting between 6 and 8 hours of sleep on weekdays.

   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  2.000   6.000   7.000   6.896   8.000  11.000 

Sample standard deviation:

[1] 1.394414

Part b

Yes

1.2.2 Calculate a 95% confidence interval for nightly sleep hours using nhanes.samp.adult and interpret the interval

You can either use the math from class to calculate this OR the t.test() function.

95% CI: 6.659, 7.134

1.2.3 Conduct a hypothesis test to assess whether on average, American adults are getting enough sleep. Let \(\mu_0\) be 8 hours, the midpoint of the range defined as adequate.

Please make sure to include all hypothesis test steps and make sure conditions are met (think CLT). There is additional information on expectations of hypothesis tests in the directions.

  • test statistic is \(-9.19661\)
  • p-value is \(3.164\times 10^{-16}\)