copper: Copper Grade at Sampling Points

copperR Documentation

Copper Grade at Sampling Points

Description

Copper grade at sampling points with their X, Y and Z coordinates within a designated area. Used in the overview article to fit a semiparametric model with a smooth in Z and a thin-plate spline in X and Y.

Usage

data(copper)
data(copperKnots)

Format

A data frame with 439 rows and 4 columns:

xcoord

X coordinate of the sampling point.

ycoord

Y coordinate of the sampling point.

zcoord

Z coordinate of the sampling point.

grade

copper grade (positive; modelled on the log scale below).

copperKnots: the 20 knots (columns xcoord, ycoord) of M. P. Wand's thin-plate spline fit of these data (a geoadditive model fitted by lme()), which semireg reproduces.

Examples

data(copper)
data(copperKnots)
# M. P. Wand's geoadditive model: a thin-plate surface over the plane with the given knots,
# and an O'Sullivan spline in depth (their linear terms are added to the fixed effects)
mod <- semireg(grade ~ s(xcoord, ycoord, bs = "ztps", xt = list(knots = as.matrix(copperKnots))) +
                 s(zcoord, bs = "os", xt = list(knots = seq(80, 120, by = 5))), data = copper)
anova(mod)   # fixed effects (Kenward-Roger) and a test of each smooth term
semipred(mod, covariate = c("xcoord", "ycoord"))$plt

# on the log scale, with the pairwise interactions of the coordinates
mod2 <- semireg(log(grade) ~ s(zcoord, bs = "os") + s(xcoord, ycoord, bs = "ztps", k = 6) +
                  xcoord:ycoord + xcoord:zcoord + ycoord:zcoord, data = copper)
semipred(mod2, covariate = "zcoord", trans = exp)$plt


predictmeans documentation built on Nov. 24, 2026, 5:10 p.m.