Question
For every assignment, you must include the R script that you wrote - pasted at the end of the assignment under the heading Code
For every assignment, you must include the R script that you wrote - pasted at the end of the assignment under the heading "Code". For full credit, code must be clearly arranged and properly commented (Type # to create a comment in R). All graphic outputs must be properly titled and labeled; take time to make plots look nice and be clear in depiction. Be clear, concise, and thorough with your answers; for many statistical questions, it is imperative that you clearly show all your steps.
The file below includestarbucks.csv with a handful of stats by state.One column (starbucks) shows how many Starbucks coffee shops are in each state.We want to test if the variation in the number of Starbucks per state is accounted for by the variation in these other variables.
a.We hypothesize that a state's gross state product per capita (gsp_pcap) will explain some of the variation in the number of Starbucks.Make a scatterplot of Starbucks vs. GSP (Y vs. X).Do you think a linear regression will explain the variability?
b.Name the parametric test we should use to answer the question.List the null and alternative hypotheses in words (related to the question at hand) and in symbols (if applicable).
c.Run a regression using lm( ).Paste the results in your answer sheet.Based on the results, do you reject or fail to reject the null hypothesis?State your reasons why.
d.Below is an output from a multiple regression test that was run earlier by me [starbucks as the dependent variable, and gsp_pcap, birthrate (birth rate per 1000), med.age (median age) and totmurder (total number of murders) as independent variables]. Based on the p values, there seems to be an odd relationship between the number of Starbucks and the number of murders per state. Run a bivariate regression of starbucks ~ totmurder.Paste the results in your answer sheet. Comment on the results. Is the strength of this relationship spurious? (Hint: think about causation and what sort of variable might co-vary with total murders)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started