Description Usage Arguments Details Value Note Author(s) Examples
Create a set of (life-)time observations (possibly with censoring), perfectly matching a given distribution.
1 |
dist |
The target distribution for creating the (life-)time observations. |
... |
Named arguments for calculating the dataset such as slope, shape, number and event vector. See section "Details". |
This function can be used for testing purposes. Internally, it is used for the experimental calculation of Monte Carlo Pivotal confidence bounds for right censored (life-)time observations.
params.to.ob("weibull",beta=3,eta=1000,n=5)
params.to.ob("lognormal",meanlog=log(1000),sdlog=log(2),n=5)
params.to.ob("weibull",beta=3,eta=1000,event=c(1,1,1,0,0))
When abrem.fit
is called on an abrem
object based on
these (life-)time observations, the same fit parameters will be found as
those used to generate the dataset.
A dataframe with two columns:
$time
An ordered vector with (life-)time observations.
$event
A vector of class "numeric"
with right-censoring indicators.
See Abrem
for more details on the indicators.
Currently, only distributions fitted with
method.fit = c("rr","xony")
are supported.
Jurgen Symynck jusy@openreliability.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## generate three synthetic datasets ##
d1 <- params.to.ob("weibull",beta=3,eta=1000,n=10)
d1 <- abrem.fit(Abrem(d1),lwd=1)
print(d1$data)
message(paste0(
" beta=",d1$fit[[1]]$beta,
", eta=",d1$fit[[1]]$eta))
d2 <- params.to.ob("weibull",beta=3,eta=1000,
event=c(1,1,0,0,0,1,0,1,0,0))
d2 <- abrem.fit(Abrem(d2,pch=3,col="red",cex.points=1.5),lty=3,lwd=3)
print(d2$data)
message(paste0(
" beta=",d2$fit[[1]]$beta,
", eta=",d2$fit[[1]]$eta))
d3 <- params.to.ob("lognormal",meanlog=log(1000),sdlog=log(2),n=10)
d3 <- abrem.fit(Abrem(d3,pch=0),dist="lognormal")
print(d3$data)
message(paste0(
" meanlog=",d3$fit[[1]]$meanlog,
", sdlog=",d3$fit[[1]]$sdlog))
plot.abrem(list(d1,d2,d3),main="Demo of params.to.ob()")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.