- Application: analytical chemistry and spectroscopy
- Goal: estimate an unknown concentration using simple linear regression
- Tool: spectrophotometer calibration curves
- Example: simulated concentrations and absorbance measurements
2026-10-18
The Beer-Lambert law relates absorbance to concentration:
\[A = \varepsilon l c\]
At a fixed wavelength and path length, absorbance should increase approximately linearly with concentration.
set.seed(42)
concentration <- seq(0.1, 1.0, by = 0.1)
absorbance <- 2.5 * concentration +
rnorm(length(concentration), mean = 0, sd = 0.05)
chem_data <- data.frame(Concentration = concentration,
Absorbance = absorbance)
model <- lm(Absorbance ~ Concentration, data = chem_data)
chem_data$Resid <- residuals(model)
summary(model)
## ## Call: ## lm(formula = Absorbance ~ Concentration, data = chem_data) ## ## Residuals: ## Min 1Q Median 3Q Max ## -0.05028 -0.03528 -0.00590 0.03609 0.06824 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 0.01901 0.03008 0.632 0.545 ## Concentration 2.51520 0.04848 51.878 2.11e-11 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Residual standard error: 0.04404 on 8 degrees of freedom ## Multiple R-squared: 0.997, Adjusted R-squared: 0.9967 ## F-statistic: 2691 on 1 and 8 DF, p-value: 2.112e-11
A calibration curve can be modeled by:
\[\hat{A} = \hat{\beta}_0 + \hat{\beta}_1 c\]
For an unknown absorbance \(A_u\), the estimated concentration is:
\[\hat{c}_u = \frac{A_u - \hat{\beta}_0}{\hat{\beta}_1}\]
Residuals help show whether the straight-line model is reasonable. Ideally, they are scattered around zero without a systematic pattern.
Suppose a sample has a measured absorbance of 1.25.
## Measured absorbance: 1.25
## Estimated concentration: 0.489 mol/L
## Model R-squared: 0.997
The regression equation converts the measured absorbance into an estimated concentration. This simulated measurement falls within the calibration range.
Note: All observations in this example were simulated rather than collected in a laboratory.