Economics 320辅导、R编程语言讲解、辅导R设计、辅导frame version

- 首页 >> Algorithm 算法

Economics 320: Homework 6

Please submit your homework to Eco320Fall2018@gmail.com

Due Wednesday, November 14th by 11:59 PM

Remember that homework assignments are to be done independently. Copying another student’s answers is

plagiarism, an academic fraud that implicates both students.

You will examine per-capita income data for U.S. counties in 2006–10, from a data.frame stored in

Counties.RData. This is the plain data.frame version, not the “spatialized” version we use for mapping.

The level of per capita income by county in the year 2000 was about $30,000. Take $30,000 as the

historical benchmark for Questions 1 and 2. NOTE: You can assume that per-capita income is a normally

distributed random variable.

Please provide your commented R script for Questions 1 and 2.

Question 1 (50 points) Is the expected level μ of per-capita income in 2006–10 different from the historical

benchmark level of the year 2000, when per-capita income was $30,000? The null hypothesis is that

H0 : μ = 30000 in 2006–10, and the alternative hypothesis is HA : μ 6= 30000. Choose the probability

of Type I Error to be 0.04, that is, 4 percent. Because we are assuming that the per-capita income

variable is normally distributed, the test statistic is distributed according to the t distribution with

N 1 “degrees of freedom” when the null hypothesis is true.

(a) Use R to calculate the rejection region. Explain your approach by including comments in your

R code.

(b) Calculate the test statistic T, print the rejection region, and print the value of the test statistic.

In your R program, please include the code you use to calculate T.

(c) Do you reject the null hypothesis? Why? Explain by including comments in your R code.

Question 2 (50 points) Is the expected level of per-capita income in 2006–10 higher than the historical

benchmark level of the year 2000, when per-capita income was $30,000? The null hypothesis is that

H0 : μ ≤ 30000 in 2006–10, and the alternative hypothesis is HA : μ > 30000. You are to choose the

probability of Type I Error to be 0.03, that is, 3 percent.

(a) Calculate the rejection region. Explain your approach by including comments in your R code.

(b) Calculate the test statistic T. Please include your code.

(c) Do you reject the null hypothesis? Why? Explain the result by including comments in your R

code.


站长地图