This function is a modified version of the BAMSAUR.bff function developed to work in the BAMSAUR shiny app, and is not intended for use in the R-console.
BAMSAUR.bff2( data, interval = "prediction", level = 0.68, varmod.method = "earth", nfold = n - 1, ncross = 3 )
data | Data frame, or object that can be coerced into a data frame, containing the ages and wear scores of individuals from a sample. |
---|---|
interval | Character. The type of age interval used. Can be either "prediction" or "confidence" intervals. |
level | Numeric. Determines the level of confidence or prediction intervals. A number between 0 and 1 (not inclusive). |
varmod.method | Character. Method for creating the variance model in the 'earth' function. See 'earth' package for more details. |
nfold | Numeric. The number of folds to be used in the cross validation. |
ncross | Numeric. Number of cross validations. Default is set at 3 to reduce computation time. |
BAMSAUR.bff uses the "lm" function for the regression analyses. It automatically provides the accuracy of the sample being evaluated, based on whether the actual age of an individual falls within the estimated age range from linear and quadratic regression analyses (using the described LOOCV method). It also provides the mean of the estimated age ranges, as an indicator of method precision, as well as the sum of squares of the residuals, and the r-squared value, for both the linear and quadratic regressions.
If the slope of the regression is significantly different (2 standard deviations) from 0 or 1, a warning message will appear.