# Bootstrap

## Bootstrap :

Bootstrap is a statistical method used to estimate the sampling distribution of a statistic through the use of resampling techniques. It involves repeatedly sampling with replacement from a dataset, calculating the statistic of interest for each sample, and then using the resulting sample of statistics to estimate the sampling distribution.
One of the key advantages of bootstrapping is that it can be used to estimate the sampling distribution of a statistic even when the underlying population distribution is unknown or complex. This is because it relies only on the sample data, rather than making assumptions about the population distribution.
For example, suppose we are interested in estimating the mean height of a population of students. We take a sample of 10 students and measure their heights, finding a sample mean of 170cm. We can use bootstrapping to estimate the sampling distribution of the sample mean, which can then be used to construct confidence intervals or perform hypothesis tests.
To do this, we first create a bootstrap sample by sampling with replacement from the original sample of 10 students. This means that we randomly select one of the 10 heights, record it, and then put it back in the sample so it can be selected again. We repeat this process a large number of times (e.g. 1000), creating a new sample of 10 heights for each iteration.
For each bootstrap sample, we calculate the sample mean. This results in a sample of 1000 sample means, which we can use to estimate the sampling distribution of the sample mean. For example, we can calculate the mean and standard deviation of the bootstrap sample means, which can be used to construct a confidence interval for the population mean.
Bootstrapping can also be used to estimate the sampling distribution of other statistics, such as the median or the standard deviation. It can also be used in combination with other methods, such as hypothesis testing or regression analysis, to provide more accurate and robust estimates.
For example, suppose we are interested in testing the hypothesis that the population mean height is equal to 175cm. We can use bootstrapping to estimate the sampling distribution of the sample mean, and then use this distribution to calculate a p-value for the hypothesis test. This can be done by calculating the proportion of bootstrap sample means that are at least as extreme as the observed sample mean, given the null hypothesis.
Another example is using bootstrapping in regression analysis. Suppose we have a dataset with two variables, x and y, and we want to fit a linear regression model to predict y based on x. We can use bootstrapping to estimate the sampling distribution of the regression coefficients, which can then be used to construct confidence intervals for the coefficients or perform hypothesis tests.
Overall, bootstrapping is a powerful and flexible statistical method that can be used to estimate the sampling distribution of a statistic in a wide range of situations. It is particularly useful when the underlying population distribution is unknown or complex, and can provide more accurate and robust estimates than other methods.