BAMSAUR.mars | R Documentation |
This function can be used to estimate age-at-death using multivariate adaptive regression splines (MARS), with the choice of using Middenbeemster as a reference population or incorporating a sample from the R-evnironment.
BAMSAUR.mars(
wear,
data = NULL,
pop = "MB11",
level = 0.68,
varmod.method = "earth",
nfold = n - 1,
ncross = 3,
...
)
wear |
Numeric. The wear score of an individual. Can be a single value or a vector containing a list of wear scores from multiple individuals. |
data |
Data frame containing one column for ages-at-death and a second column for the average wear scores. Not required when pop = "MB11" is selected. |
pop |
Character. Indicates which reference population to use. "MB11" and "other" are supported. When "other" is selected, the data input is required. |
level |
Numeric. Determines the level of confidence or prediction intervals. Is a number between 0 and 1 (not inclusive). 0.68, 0.90, or 0.95 is recommended. The default is set at 0.68. |
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. |
... |
Additional arguments can be passed to the 'earth' function. See ?earth for more details. |
This function uses the "earth" function for the MARS analyses, and age ranges are provided by the predict function.
a data frame containing the following values:
wear
The wear score(s) initially applied to the function
estimate
Age-at-death estimate(s) calculated from the wear score(s)
range
the age range (+- years) of the estimate, determined by the type and level.
lower
the lower bound of the age interval.
upper
the upper bound of the age interval.
#The following example calculates the ages-at-death with 90%PIs of 10 random wear scores
wear <- runif(10,0,16)
BAMSAUR.mars(wear, level = 0.90)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.