- Goal: Estimate concrete parameters based on a group of samples
- Two types of estimates:
- Point estimate: single value
- Interval estimate: range of values (confidence interval)
2025-06-09
You collect compressive strength values from 30 samples (Mpa).
set.seed(42) strength = rnorm(30, mean = 40, sd = 5) summary(strength)
## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 26.72 38.00 39.50 40.34 45.35 51.43
The point estimate for the population mean is the sample mean:
mean_strength = mean(strength) mean_strength
## [1] 40.34293
\(begin:math:display\) \bar{x} \pm t_{\alpha/2, n-1} \cdot \frac{s}{\sqrt{n}} \(end:math:display\)
n = length(strength) s = sd(strength) t_value = qt(0.975, df=n-1) ci_lower = mean_strength - t_value * s / sqrt(n) ci_upper = mean_strength + t_value * s / sqrt(n)
c(ci_lower, ci_upper)
## [1] 37.99976 42.68611
library(ggplot2) ggplot(data.frame(strength), aes(x=strength)) + geom_histogram(binwidth=2, fill="skyblue", color="black") + labs(title="Distribution of Measured Concrete Strength", x="Strength (MPa)", y="Frequency")
ggplot(data.frame(x=1, y=mean_strength), aes(x=x, y=y)) + geom_point(size=4) + geom_errorbar(aes(ymin=ci_lower, ymax=ci_upper), width=0.1) + xlim(0.5, 1.5) + labs(title="Point Estimate with 95% Confidence Interval", y="Strength (MPa)", x="")
library(plotly)
## ## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2': ## ## last_plot
## The following object is masked from 'package:stats': ## ## filter
## The following object is masked from 'package:graphics': ## ## layout
plot_ly(x = ~strength, type = "box", name = "Concrete Strength") %>% layout(title = "Interactive Boxplot of Concrete Strength")
-Point estimate: ‘r round(mean_strength, 2)’ MPa -95% CI: between ‘r round(ci_lower, 2)’ and ‘r round(ci_upper, 2)’ MPa - This method helps infer properties from limited sample data.