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,
  ...
)

Arguments

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.

Value

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.

Details

This function uses the "earth" function for the MARS analyses, and age ranges are provided by the predict function.

Examples

#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)
#> Calculating...
#> wear estimate +- years lower upper #> 1 8.265383 10.72 2.50 8.22 13.22 #> 2 6.802117 8.88 2.27 6.61 11.15 #> 3 8.447292 10.95 2.52 8.43 13.47 #> 4 13.229053 25.05 2.58 22.47 27.63 #> 5 2.044618 2.89 1.56 1.33 4.45 #> 6 7.963841 10.34 2.45 7.89 12.79 #> 7 11.649588 20.04 2.58 17.46 22.62 #> 8 3.195358 4.34 1.73 2.61 6.07 #> 9 11.378115 19.18 2.58 16.60 21.76 #> 10 14.326643 28.52 2.58 25.94 31.10