2026-10-18

Introduction to Spectrophotometry

  • Application: analytical chemistry and spectroscopy
  • Goal: estimate an unknown concentration using simple linear regression
  • Tool: spectrophotometer calibration curves
  • Example: simulated concentrations and absorbance measurements

Beer-Lambert Law

The Beer-Lambert law relates absorbance to concentration:

\[A = \varepsilon l c\]

  • \(A\): absorbance (unitless)
  • \(\varepsilon\): molar absorptivity (L mol\(^{-1}\) cm\(^{-1}\))
  • \(l\): path length (cm)
  • \(c\): concentration (mol/L)

At a fixed wavelength and path length, absorbance should increase approximately linearly with concentration.

R Output: Simulation & Model Setup

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

Simple Linear Regression Equation

A calibration curve can be modeled by:

\[\hat{A} = \hat{\beta}_0 + \hat{\beta}_1 c\]

  • \(\hat{A}\): predicted absorbance
  • \(\hat{\beta}_0\): fitted intercept
  • \(\hat{\beta}_1\): fitted slope (change in absorbance per mol/L)
  • \(c\): known concentration

For an unknown absorbance \(A_u\), the estimated concentration is:

\[\hat{c}_u = \frac{A_u - \hat{\beta}_0}{\hat{\beta}_1}\]

ggplot Plot 1: Calibration Curve

ggplot Plot 2: Residual Analysis

Residuals help show whether the straight-line model is reasonable. Ideally, they are scattered around zero without a systematic pattern.

Plotly 3D Interactive Plot

Predicting an Unknown Concentration

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.

Conclusion & Key Findings

  • The Beer-Lambert law explains why absorbance is related to concentration.
  • Simple linear regression produces a calibration equation from known samples.
  • The calibration curve shows the fitted trend; residuals help assess the fit.
  • The 3D visualization illustrates how both concentration and path length affect absorbance.
  • The fitted equation can estimate an unknown concentration within the calibrated range.

Note: All observations in this example were simulated rather than collected in a laboratory.