2024-03-21

3D Scatter Plot

  • Interactively visualize our sample data in 3D.

Distribution of X

Scatter Plot of X vs Y

Point Estimation Concepts

Point estimators aim to provide the best single-value guess for population parameters. The mean (\(\)) and variance (\(^2\)) are common targets of point estimation.

  • The sample mean (\({x}\)) is an unbiased estimator of the population mean (\(\)).
  • The sample variance (\(s^2\)) is an unbiased estimator of the population variance (\(^2\)).

\[\bar{x} = \frac{1}{n}\sum_{i=1}^{n}x_i\]

\[s^2 = \frac{1}{n-1}\sum_{i=1}^{n}(x_i - \bar{x})^2\]

Estimating Parameters

  • When estimating parameters, it’s crucial to understand the distribution of the estimator.
  • The Central Limit Theorem (CLT) tells us that the sampling distribution of the sample mean will be approximately normal, regardless of the population’s distribution, given a sufficiently large sample size.

\[\frac{\bar{X} - \mu}{\sigma / \sqrt{n}} \xrightarrow{d} N(0, 1)\] This approximation allows us to make probabilistic statements about where the population mean lies, based on our sample. Variables Explained:

  • \(\bar{X}\): The sample mean, which is the average of all observations in the sample.
  • \(\mu\): The population mean, which is the average of all observations in the population.
  • \(\sigma\): The population standard deviation, a measure of the dispersion of the population.
  • \(n\): The sample size, or the number of observations in the sample.
  • \(N(0, 1)\): Denotes the standard normal distribution, which has a mean of 0 and a standard deviation of 1.
  • \(\xrightarrow{d}\): Denotes convergence in distribution, indicating that as the sample size increases, the distribution of the standardized sample mean approaches a standard normal distribution.

Generating a Plot in R

The following R code snippet demonstrates how to create a histogram of the X variable from our sample dataset. Histograms are useful for visualizing the distribution of a dataset.

# Plotting a histogram of the X variable
ggplot(sample_data, aes(x)) +
  geom_histogram(binwidth = 0.5, fill = "steelblue", color = "black") +
  theme_minimal() + ggtitle("Distribution of X") +
  theme(plot.title = element_text(hjust = 0.5))

Confidence Intervals

Confidence intervals give us a range of plausible values for some population parameter (like the mean) based on a sample statistic. For the mean, a common confidence interval can be constructed using the sample mean ± margin of error, where the margin of error is defined as the standard error of the mean multiplied by a critical value from the distribution.

  • A 95% confidence interval for the mean is given by:

\[\bar{x} \pm z \left(\frac{s}{\sqrt{n}}\right)\]

Where \(z\) is the critical value from the standard normal distribution corresponding to 95% confidence (approximately 1.96 for 95% confidence), \(s\) is the sample standard deviation, and \(n\) is the sample size.

Confidence Interval

# Calculate the sample mean and standard deviation
sample_mean <- mean(sample_data$x)
sample_sd <- sd(sample_data$x)
n <- length(sample_data$x)

# Calculate the 95% confidence interval for the mean
z <- qnorm(0.975) # Critical value for 95% confidence
margin_of_error <- z * (sample_sd / sqrt(n))
ci_lower <- sample_mean - margin_of_error
ci_upper <- sample_mean + margin_of_error

# Display the confidence interval
paste("95% Confidence Interval for the Mean: [", round(ci_lower, 2),
      ", ", round(ci_upper, 2), "]", sep = "")
## [1] "95% Confidence Interval for the Mean: [-0.09, 0.27]"

Conclusion

Point estimation provides a single best guess about a population parameter. The methods I have discussed and visualized today are fundamental in statistics for understanding and analyzing the characteristics of data.