Learn R Programming

vein (version 1.1.3)

age: Applies a survival rate to numeric new vehicles

Description

age returns survived vehicles

Usage

age(x, type = "weibull", a = 14.46, b = 4.79, agemax, verbose = FALSE)

Value

dataframe of age distrubution of vehicles

Arguments

x

Numeric; numerical vector of sales or registrations for each year

type

Character; any of "gompertz", "double_logistic", "weibull" and "weibull2"

a

Numeric; parameter of survival equation

b

Numeric; parameter of survival equation

agemax

Integer; age of oldest vehicles for that category

verbose

Logical; message with average age and total numer of vehicles regions or streets.

See Also

Other age: age_hdv(), age_ldv(), age_moto()

Examples

Run this code
if (FALSE) {
vehLIA <- rep(1, 25)
PV_Minia <- age(x = vehLIA)
PV_Minib <- age(x = vehLIA, type = "weibull2", b = 11, a = 26)
PV_Minic <- age(x = vehLIA, type = "double_logistic", b = 21, a = 0.19)
PV_Minid <- age(x = vehLIA, type = "gompertz", b = -0.137, a = 1.798)
dff <- data.frame(PV_Minia, PV_Minib, PV_Minic, PV_Minid)
colplot(dff)
}

Run the code above in your browser using DataLab