Point estimation is a statistical technique that is used to estimate the value of a population parameter using sample data.
- Example: Estimating the population mean using the sample mean.
- The sample mean is the most common point estimate.
2025-03-25
Point estimation is a statistical technique that is used to estimate the value of a population parameter using sample data.
The sample mean is calculated as:
\[ \bar{x} = \frac{1}{n} \sum_{i=1}^n x_i \]
Where: - \(\bar{x}\) is the sample mean - \(n\) is the sample size - \(x_i\) are the individual sample values
Sample data will be generated and the sample mean will be calculated using R.
# Generating sample data set.seed(123) data <- rnorm(100, mean = 50, sd = 10) # Calculating sample mean sample_mean <- mean(data) # Displaying sample mean explicitly as part of the slide sample_mean
## [1] 50.90406
We will visualize the distribution of the data using a histogram with the sample mean as a vertical line.
There can be bias, which refers to the over or underestimation of the true value. If the expected and true value are the same then it is unbiased. We’ll visualize the bias by comparing the sample mean (point estimator) with the population mean.
We will calculate the 95% confidence interval for the mean using a t-test.
# Generate data data_values <- rnorm(100, mean = 50, sd = 10) # Perform the t-test ci_result <- t.test(data_values) # Display the confidence interval ci_result$conf.int
## [1] 47.00582 50.84324 ## attr(,"conf.level") ## [1] 0.95
We will plot the histogram with the 95% confidence interval bounds using Plotly.
The margin of error (MOE) represents the range within which the true population parameter is likely to fall, given the sample data.
To calculate the margin of error, we subtract the lower bound of the confidence interval from the upper bound and divide by 2.
# Generate sample data set.seed(123) data_values <- rnorm(100, mean = 50, sd = 10) # Perform t-test to get the confidence interval ci_result <- t.test(data_values) # Calculate the margin of error (MOE) moe <- (ci_result$conf.int[2] - ci_result$conf.int[1]) / 2 moe
## [1] 1.811225