Fit data to a specified allometric equation, for one species. Allometric
equations that may be considered as an input to this function can be found in
?eqns_info
and data(eqns_info)
.
ss_modelfit(data, modelcode, response = "height", predictor = "diameter")
Dataframe that contains the variables of interest. Each row is a measurement for an individual tree.
Character string of the model code for the selected
allometric equation. Refer to ?eqns_info
and data(eqns_info)
for more
information.
Column name of the response variable. Defaults to height
.
Column name of the predictor variable. Defaults to
diameter
.
A list of 2 elements:
Resulting model object.
Table showing information on the resulting model.
A dataframe with the following variables:
Model code for the allometric equation used.
Parameter estimates.
Geometric mean of the response variable used in calculation of AICc (only for transformed models).
Bias correction factor to use on model predictions (only for transformed models).
Range of the predictor variable within the data used to generate the model.
Range of the response variable within the data used to generate the model.
Residual standard error of the model.
Mean standard error of the model.
Adjusted \(R^2\) of the model.
Sample size (no. of trees used to fit model).
McPherson E. G., van Doorn N. S. & Peper P. J. (2016) Urban Tree Database and Allometric Equations. General Technical Report PSW-GTR-253, USDA Forest Service, 86.
ss_modelfit_multi()
to fit specified models across multiple
species.
ss_modelselect()
to select a best-fit model for one species.
ss_modelselect_multi()
to select best-fit models across multiple species.
Other single-species model functions:
ss_modelfit_multi()
,
ss_modelselect_multi()
,
ss_modelselect()
,
ss_predict()
,
ss_simulate()
data(urbantrees)
Alb_sam <- urbantrees[urbantrees$species == 'Albizia saman', ]
results <- ss_modelfit(Alb_sam,
modelcode = 'quad_w1', # manually specify equation to use
response = 'height', predictor = 'diameter')
results$fitted_model
#>
#> Call:
#> lm(formula = y ~ x + I(x^2))
#>
#> Coefficients:
#> (Intercept) x I(x^2)
#> 4.808 14.498 -3.098
#>
results$fitted_model_info
#> modelcode a b c d e response_geom_mean
#> 1 quad_w1 4.807887 14.49773 -3.097745 NA NA 13.56608
#> correctn_factor predictor_min predictor_max response_min response_max
#> 1 1 0.3119437 1.527887 8 20
#> residual_SE mean_SE adj_R2 n
#> 1 2.2047 4.7509 0.4278 133