(Generalised) Linear models from normalised ratio indices
Build (generalised) linear models of normalised ratio indices as response and predictor variables usually stored in the SI.
lm.nri(formula, preddata = NULL, ...) glm.nri(formula, preddata = NULL, ...)
formula |
Formula for (generalized) linear model |
preddata |
Data frame or speclib containing predictor variables |
... |
Further arguments passed to |
NRI-values may be used as predictor or response variable. If NRI-values are predictors, the models are build only with one index as predictor instead of all available indices. In this case, only one predictor and one response variable is currently allowed. See help pages for lm
and glm
for any additional information. Note that this function does not store the entire information returned from a normal (g)lm-model. To get full (g)lm-models use either the function nri_best_performance
to return best performing model(s) or extract nri-values with getNRI
and build directly the model from respective index.
See details in Nri-plot
-method for information about plotting.
The function returns an object of class Nri
. The list in the slot multivariate contains the new (g)lm information which depends on the kind of model which is applied:
lm.nri
:
The list contains the following items:
Estimate: Coefficient estimates for each index and term
Std.Error: Standard errors
t.value: T-values
p.value: P-values
r.squared: R^2 values
glm.nri
:
The list contains the following items (depending on formula used):
Estimate: Coefficient estimates for each index and term
Std.Error: Standard errors
t.value/z.value: T-values or Z-values
p.value: P-values
Lukas Lehnert
data(spectral_data) ## Calculate all possible combinations for WorldView-2-8 spec_WV <- spectralResampling(spectral_data, "WorldView2-8", response_function = FALSE) nri_WV <- nri(spec_WV, recursive = TRUE) glmnri <- glm.nri(nri_WV ~ chlorophyll, preddata = spec_WV) glmnri plot(glmnri)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.