Macro 1 - Bootstrap
Macro 1 - Bootstrap
Macro 1 - Bootstrap
300
240
202
24
230
49
109
128
239
199
370
280
154
109
259
259
300
280
24
199
154
259
259
109
109
128
370
109
280
154
- Sample 2, Sample 3,
191.4
188.6
226.9
187.2
243.2
210.1
196.8
Let n be the sample size of the original data, and let m be the
number of bootstrap samples. We start by creating n*m random
numbers which take on integer values 1,2,n. These values
represent our index. To create a random sample we perform a
join* based on the record id of the original sample and our
random index. For example:
n=4,m=2
Record Id
Original Sample
Random Index
Sample Value
3
The last step is to group our newly created data using the tile tool
(Sample 1 - Blue; Sample 2 - Green) and make it look pretty with
the cross tab tool.
*Alteryx automatically sorts the data by sample value during the
join, so to get back our random samples we un-sort by sorting
based on the original record id.
2) Calculating complicated test statistics with the R Tool:
An un-intuitive feature of the macro is the option to specify a test
statistic using the R tool.
When this option is selected data will be passed into R and run
through the following code: