Exercise

# Step-by-step through the permutation

To help you understand the code used to create the randomization distribution, this exercise will walk you through the steps of the `infer`

framework. In particular, you'll see how differences in the generated replicates affect the calculated statistics.

After running the `infer`

steps, be sure to notice that the numbers are slightly different for each replicate.

Instructions

**100 XP**

The `dplyr`

and `infer`

packages have been loaded for you, along with the `disc`

data frame from the last exercise.

- Call the functions for the first three steps. The work has been done for you, your job is to investigate the results of calling the first three
`infer`

steps. - In order to see the effect of permuting,
- group the permuted data frame,
`disc_perm`

, by the new`replicate`

variable, then - count the variables of interest (
`promote`

within each`sex`

) using`count()`

.

- group the permuted data frame,
- Using
`disc_perm`

,`calculate()`

the statistic of interest. Set`stat`

to`"diff in props"`

and`order`

to`c("male", "female")`

.