params.to.ob: Create (un-)Censored Testdata from Distribution Parameters

Description Usage Arguments Details Value Note Author(s) Examples

Description

Create a set of (life-)time observations (possibly with censoring), perfectly matching a given distribution.

Usage

1

Arguments

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".

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.

generating Weibull datasets

params.to.ob("weibull",beta=3,eta=1000,n=5)

generating Lognormal datasets

params.to.ob("lognormal",meanlog=log(1000),sdlog=log(2),n=5)

censoring, event vector

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.

Value

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.

Note

Currently, only distributions fitted with method.fit = c("rr","xony") are supported.

Author(s)

Jurgen Symynck jusy@openreliability.org

Examples

 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()")

abrem documentation built on May 2, 2019, 4:49 p.m.