- 1 Menu items
- 2 Randomized Complete Block Design (RCBD)
- 2.1 Data
- 2.2
**(2 p)**Reshape and plot the data, describe relationships of Sales between Items and Restaurants - 2.3
**(0 p)**Fit model - 2.4
**(3 p)**Assess model assumptions - 2.5
**(2 p)**State and interpret the hypothesis test for difference in Item mean sales - 2.6
**(2 p)**If appropriate, perform pairwise comparisons with Tukey HSD correction - 2.7
**(1 p)**What is your recommendation to the Franchise?

Following the in-class assignment this week, perform a complete RCBD analysis.

- (2 p) Reshape and plot the data, describe relationships of Sales between Items and Restaurants
- (0 p) Fit model
- (3 p) Assess model assumptions
- (2 p) State and interpret the hypothesis test for difference in Item mean sales
- (2 p) If appropriate, perform pairwise comparisons with Tukey HSD correction
- (1 p) What is your recommendation to the Franchise?

The code below will get you started with reshaping the data. The rest is up to you!

```
dat_food_long <-
dat_food %>%
pivot_longer(
cols = starts_with("Item")
, names_to = "Item"
, values_to = "Sales"
) %>%
mutate(
Item = factor(Item)
)
str(dat_food_long)
```

```
Classes 'tbl_df', 'tbl' and 'data.frame': 18 obs. of 3 variables:
$ Restaurant: Factor w/ 6 levels "A","B","C","D",..: 1 1 1 2 2 2 3 3 3 4 ...
$ Item : Factor w/ 3 levels "Item1","Item2",..: 1 2 3 1 2 3 1 2 3 1 ...
$ Sales : int 31 27 24 31 28 31 45 29 46 21 ...
```

```
# A tibble: 3 x 2
Item m
<fct> <dbl>
1 Item1 33.7
2 Item2 25.8
3 Item3 39.2
```

```
# A tibble: 6 x 2
Restaurant m
<fct> <dbl>
1 A 27.3
2 B 30
3 C 40
4 D 29
5 E 41.3
6 F 29.7
```