| soil | R Documentation |
Soil chemistry properties measured on a regular grid of 10 × 25 points, spaced by 5 meters. Each record contains the chemical composition and coordinates of the soil sample.
data(soil)
A data.frame with 250 observations and 9 variables:
COORD.XX coordinate of the sampling point.
COORD.YY coordinate of the sampling point.
SANDProportion of sand in the soil sample.
SILTProportion of silt in the soil sample.
CLAYProportion of clay in the soil sample.
PHWATERSoil pH measured in water.
CACalcium content of the soil.
MGMagnesium content of the soil.
KPotassium content of the soil.
Bonat, W. H. (2018). "Multiple Response Variables Regression Models in R: The mcglm Package." Journal of Statistical Software, 84(4):1–30.
library(mcglm)
data(soil, package = "mcglm")
# Spatial model (tri2nb could be used but takes long)
Z1 <- mc_id(soil)
# Linear predictor example
form.ca <- CA ~ COORD.X*COORD.Y + SAND + SILT + CLAY + PHWATER
fit.ca <- mcglm(
linear_pred = c(form.ca),
matrix_pred = list(Z1),
link = "log",
variance = "tweedie",
covariance = "inverse",
power_fixed = TRUE,
data = soil,
control_algorithm = list(
max_iter = 1000,
tuning = 0.1,
verbose = FALSE,
tol = 1e-03
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.