- Using R Randomization Test - "When waiting to get someone's parking space, have you ever thought...

50.1K

Verified Solution

Question

Basic Math

- Using R Randomization Test -

"When waiting to get someone's parking space, have you everthought that the driver you are waiting for is taking longer thannecessary? Ruback and Juieng (1997) ran a simple experiment toexamine that question. They hung out in parking lots and recordedthe time that it took for a car to leave a parking place. Theybroke the data down on the basis of whether or not someone inanother car was waiting for the space.

The data are positively skewed, because a driver can safelyleave a space only so quickly, but, as we all know, they cansometimes take a very long time. But because the data are skewed,we might feel distinctly uncomfortable using a parametric t test.So we will adopt a randomization test."

```{r}
# no waiting records the time it took a driver to leave the parkingspot if no one was waiting for the driver
no_waiting <- c(36.30, 42.07, 39.97, 39.33, 33.76, 33.91, 39.65,84.92, 40.70, 39.65,
39.48, 35.38, 75.07, 36.46, 38.73, 33.88, 34.39, 60.52, 53.63,50.62)

# waiting records the time it takes a driver to leave if someonewas waiting on the driver
waiting <- c(49.48, 43.30, 85.97, 46.92, 49.18, 79.30, 47.35,46.52, 59.68, 42.89,
49.29, 68.69, 41.61, 46.81, 43.75, 46.55, 42.33, 71.48, 78.95,42.06)


mean(waiting)
mean(no_waiting)
obs_dif <- mean(waiting) - mean(no_waiting)
```

Conduct a randomization test to test the hypothesis that thereis no difference in average time for drivers who have a personwaiting vs those who do not have a person waiting, against thealternative that drivers who have a person waiting will take*longer* than if they did not.

Be sure to calculate an empirical p-value and make theappropriate conclusion.

Answer & Explanation Solved by verified expert
3.8 Ratings (713 Votes)
Here to test the difference in average time for drivers we use Twosample ttest Here the hypothesis is H0 12 vs H1 12 output of the test Routput nowaiting nowaiting 1 3630 4207 3997 3933    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students