Question

R work (must be done in R) Copy and paste your R code and output into...

R work (must be done in R)

Copy and paste your R code and output into a word document, along with your written answers to the questions.

Follow these instructions to import the necessary dataset:

 Before opening the dataset needed for this problem, you’ll need to call the “car” package. Run the following line of code:

> library(car)

 Now you can import the “ States” dataset and use it to answer the question below. Name the data frame with your EID:

> eid <- States

Remember to include any code you use along with your answers in your submission!

3. The “States” dataset contains educational information from all 50 states and Washington D.C. collected in 1992 by the U.S. Census Bureau. Let’s consider that this dataset represents a sample of statewide data over time, and we are interested if there are any differences in the average teacher’s salary (the pay variable, measured in $1,000s) in New England states compared to mountain region states (as defined by the region variable).

Conduct the appropriate analysis to answer this question. Include all steps for full credit.

Homework Answers

Answer #1

Here is the test statistic for comparison between two means:

install.packages("car")
library(car)
eid <- States
mtn <- eid[which(eid$region=="MTN"),"pay"]
ne <- eid[which(eid$region=="NE"),"pay"]
n1 <- length(mtn)
n2 <- length(ne)
m.mtn <- mean(mtn)
sd.mtn <- sd(mtn)
m.ne <- mean(ne)
sd.ne <- sd(ne)
Numerator <- m.mtn - m.ne # Difference of Means
Denominator1 <- sd.mtn^2/n1 #var(mtn)/Sample Size
Denominator2 <- sd.ne^2/n2 #var(ne)/Sample Size
Statistic <- Numerator/sqrt(Denominator1 + Denominator2) #-2.60494
#t-statistic at 5% level of significance, two sided
# df = 8+5 -2 =11
qt(0.025,11) # -2.200985
# Calculated Value is less than tabulated value.
# Hence we can reject our null hypothesis
# Null : Means are equal
# Alternate : Means are different

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
CONSIDER THE FOLLOWING PROPOSITION: "The way income and wealth inequality (stratification) has changed over the past...
CONSIDER THE FOLLOWING PROPOSITION: "The way income and wealth inequality (stratification) has changed over the past decades in the United States today is beneficial for our individual citizens as well as serving the greater good of our American Society." You must answer all three questions: 1.     Describe your position regarding the statement above. 2.     Present specific data from chapter 8 or articles that you believe support your conclusions. 3.     If you were "in charge" of this country how would you re-design the effort/reward...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...