```r
library(mgcv)
gam_mod<-gam(data=d,HeCM~s(DiMM))
summary(gam_mod)
```

```
## 
## Family: gaussian 
## Link function: identity 
## 
## Formula:
## HeCM ~ s(DiMM)
## 
## Parametric coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   85.453      1.265   67.56   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Approximate significance of smooth terms:
##           edf Ref.df     F p-value    
## s(DiMM) 4.106  5.096 202.2  <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## R-sq.(adj) =  0.802   Deviance explained = 80.5%
## GCV = 417.93  Scale est. = 409.6     n = 256
```