Homework 2

Answer Key

Deadline: Sunday, September 29, 11:59 PM

Instructions: Use the provided Quarto template to complete your assignment. Submit the PDF rendered by your Quarto document on Gradescope. You must show your work/justify your answers to receive credit.

Click here to download the template (right click and choose “save link as”)

 

  1. (8 points) Let \(X_1,X_2,...,X_n \stackrel {iid}{\sim} N(\mu,1)\), and recall the Normal PDF: \(f(x)=\frac{1}{\sqrt{2\pi\sigma^2 }} e^{\frac{-(x-\mu)^2 }{2\sigma^2} }\)

    a. Write the likelihood function \(L(\mu)\)

    b. Write the log-likelihood function \(l(\mu)\)

    c. Find the maximum likelihood estimator of \(\mu\)

    d. Determine if the MLE \(\hat{\mu}\) is an unbiased estimator of \(\mu\)

 

 

Questions 2-5 use the births14 dataset in the openintro package. Read about the dataset and reference the codebook here

  1. (6 points) First, do some initial data exploration:

    a. How many observations and how many variables are in the dataset? What does each row represent (i.e., what is the observational unit?)

    b. Which variables, if any, contain missing data?

    c. What is the count and percentage of low birth weight vs not low birth weight babies?

 

  1. (10 points) Is the median birth weight different when the mother smokes? Conduct a hypothesis test to investigate:

    a. Write the null and alternative hypotheses.

    b. Calculate the observed statistic.

    c. Simulate the null distribution and calculate the p-value. Interpret the p-value in the context of the problem.

    d. Generate a bootstrap confidence interval and interpret the interval.

    e. Generate a plot to illustrate the median birth weight when the mother smokes vs doesn’t smoke.

     

  2. (8 points) Is there a relationship between premature birth and low birth weight? Conduct a hypothesis test to investigate:

    a. Create a 2x2 table to show the counts of the two relevant variables

    b. What are the necessary conditions to conduct a Chi-square test of independence, and are those conditions met?

    c. Conduct the appropriate test. Write the null and alternative hypotheses, calculate and report the p-value, and interpret it in the context of the problem.

    d. Generate a plot to illustrate the relationship between premature birth and low birth weight.

     

  3. (10 points) Is there a relationship between hospital visits during pregnancy and mean mother’s age? Conduct a hypothesis test to investigate:

    a. Create a new variable that categorizes the number of visits as: 10 or fewer, 11-15, more than 15

    b. Calculate the mean of mother’s age for each of the visit categories that you created in part a.

    c. What is the appropriate test to assess the research question? Write the null and alternative hypotheses.

    d. Conduct the appropriate test; calculate and report the p-value and interpret it in the context of the problem.

    e. Generate a plot to illustrate the relationship between mother’s age and the categorized visit variable.