Uploaded July 2021 | Updated September 2026, 2 weeks ago
#DataScience #Bootstrap #Resampling #Julia #VSCode #Confidence #Intervals #Probability
In this video I show you how to think about using bootstrap resampling to express uncertainty in a statistic and also how to think about the sampling distribution of a test statistic and the probability of that test statistic. Using the Julia Language in Visual Studio Code we generate values for a continuous numerical variable for two groups (generated from the two sample space elements of a categorical variable).
Our test statistic is the difference in means for the variable between the two groups. We generate a sampling distribution of the test statistic under the assumption of the null hypothesis. The latter states that there is no difference between the two means, that is, the test statistic is zero. Given this assumption we can randomly reassign subjects to the two groups and recalculate the test statistic. Doing this many times over produces the sampling distribution. We can then see how many of the resampled tests statistics are below the negative of our test statistic and how many are more than positive our test statistic. Adding these and expressing it as a fraction of the number of resamples gives us the p value for our statistic.
We also express the mean for the variable in both groups as a whole. We must consider the uncertainty in this statistic. We estimate the lower and upper bounds for the parameter in the population. This is the confidence interval.
#DataScience #Bootstrap #Resampling #Julia #VSCode #Confidence #Intervals #Probability
In this video I show you how to think about using bootstrap resampling to express uncertainty in a statistic and also how to think about the sampling distribution of a test statistic and the probability of that test statistic. Using the Julia Language in Visual Studio Code we generate values for a continuous numerical variable for two groups (generated from the two sample space elements of a categorical variable).
Our test statistic is the difference in means for the variable between the two groups. We generate a sampling distribution of the test statistic under the assumption of the null hypothesis. The latter states that there is no difference between the two means, that is, the test statistic is zero. Given this assumption we can randomly reassign subjects to the two groups and recalculate the test statistic. Doing this many times over produces the sampling distribution. We can then see how many of the resampled tests statistics are below the negative of our test statistic and how many are more than positive our test statistic. Adding these and expressing it as a fraction of the number of resamples gives us the p value for our statistic.
We also express the mean for the variable in both groups as a whole. We must consider the uncertainty in this statistic. We estimate the lower and upper bounds for the parameter in the population. This is the confidence interval.










