Skip to main content
added 5 characters in body
Source Link

If you understand mortality rate to be the rate at which individuals die between regular time intervals, then you'd want to identify the time interval and how many individuals of the total population decease during each interval. I do this and comment below.

dat <- c(5, 8, 202, 302, 24, 300, 295, 277, 8114, 195, 169, 257, 1, 7490, 2938,
334, 7793, 566, 194, 6698, 164, 1, 5371, 5282, 0, 1327, 3, 2301, 367, 177, 1,
286, 496, 8309, 3074, 964, 10843, 252, 265, 4256, 0, 0, 88, 3, 3614, 5708, 8519,
325, 8367)

n.dat <- length(dat)

interval <- 365 # Time interval (I set 365 incase the units of your data were in
# days)
max.dat <- max(dat)
bins <- seq(from = 0, to = max.dat, by = interval)
counts <- table(cut(x = dat, breaks = bins))/n.dat

plot(x = bins[-1]/365, y = as.numeric(counts), type = "l", las = 1) # there's
# always 1 bin point greater than the count, so one needs to be removed or
# midpoints can be caluculatedcalculated

These data suggest that the mortality rate is primarily when the organism is very young (within the first year), but relatively steady until just after 20 years.

There's really no reason to smooth make an arbitrary "curve" unless you are aiming to create a predictive model from these data, but it doesn't seem like that is your intent.

If you understand mortality rate to be the rate at which individuals die between regular time intervals, then you'd want to identify the time interval and how many individuals of the total population decease during each interval. I do this and comment below.

dat <- c(5, 8, 202, 302, 24, 300, 295, 277, 8114, 195, 169, 257, 1, 7490, 2938,
334, 7793, 566, 194, 6698, 164, 1, 5371, 5282, 0, 1327, 3, 2301, 367, 177, 1,
286, 496, 8309, 3074, 964, 10843, 252, 265, 4256, 0, 0, 88, 3, 3614, 5708, 8519,
325, 8367)

n.dat <- length(dat)

interval <- 365 # Time interval (I set 365 incase the units of your data were in
days)
max.dat <- max(dat)
bins <- seq(from = 0, to = max.dat, by = interval)
counts <- table(cut(x = dat, breaks = bins))/n.dat

plot(x = bins[-1]/365, y = as.numeric(counts), type = "l", las = 1) # there's
always 1 bin point greater than the count, so one needs to be removed or
midpoints can be caluculated

These data suggest that the mortality rate is primarily when the organism is very young (within the first year), but relatively steady until just after 20 years.

There's really no reason to smooth make an arbitrary "curve" unless you are aiming to create a predictive model from these data, but it doesn't seem like that is your intent.

If you understand mortality rate to be the rate at which individuals die between regular time intervals, then you'd want to identify the time interval and how many individuals of the total population decease during each interval. I do this and comment below.

dat <- c(5, 8, 202, 302, 24, 300, 295, 277, 8114, 195, 169, 257, 1, 7490, 2938,
334, 7793, 566, 194, 6698, 164, 1, 5371, 5282, 0, 1327, 3, 2301, 367, 177, 1,
286, 496, 8309, 3074, 964, 10843, 252, 265, 4256, 0, 0, 88, 3, 3614, 5708, 8519,
325, 8367)

n.dat <- length(dat)

interval <- 365 # Time interval (I set 365 incase the units of your data were in
# days)
max.dat <- max(dat)
bins <- seq(from = 0, to = max.dat, by = interval)
counts <- table(cut(x = dat, breaks = bins))/n.dat

plot(x = bins[-1]/365, y = as.numeric(counts), type = "l", las = 1) # there's
# always 1 bin point greater than the count, so one needs to be removed or
# midpoints can be calculated

These data suggest that the mortality rate is primarily when the organism is very young (within the first year), but relatively steady until just after 20 years.

There's really no reason to smooth make an arbitrary "curve" unless you are aiming to create a predictive model from these data, but it doesn't seem like that is your intent.

Source Link

If you understand mortality rate to be the rate at which individuals die between regular time intervals, then you'd want to identify the time interval and how many individuals of the total population decease during each interval. I do this and comment below.

dat <- c(5, 8, 202, 302, 24, 300, 295, 277, 8114, 195, 169, 257, 1, 7490, 2938,
334, 7793, 566, 194, 6698, 164, 1, 5371, 5282, 0, 1327, 3, 2301, 367, 177, 1,
286, 496, 8309, 3074, 964, 10843, 252, 265, 4256, 0, 0, 88, 3, 3614, 5708, 8519,
325, 8367)

n.dat <- length(dat)

interval <- 365 # Time interval (I set 365 incase the units of your data were in
days)
max.dat <- max(dat)
bins <- seq(from = 0, to = max.dat, by = interval)
counts <- table(cut(x = dat, breaks = bins))/n.dat

plot(x = bins[-1]/365, y = as.numeric(counts), type = "l", las = 1) # there's
always 1 bin point greater than the count, so one needs to be removed or
midpoints can be caluculated

These data suggest that the mortality rate is primarily when the organism is very young (within the first year), but relatively steady until just after 20 years.

There's really no reason to smooth make an arbitrary "curve" unless you are aiming to create a predictive model from these data, but it doesn't seem like that is your intent.