wblr: Create a 'wblr' Object for Life Data Analysis

View source: R/wblr.R

wblrR Documentation

Create a wblr Object for Life Data Analysis

Description

This function creates an object of class "wblr" for further processing by the other functions of wblr.

Usage

wblr(x, s=NULL, interval=NULL,...)

Arguments

x

Either a dataframe containing at least $time and $event columns and optionally a $qty column, or a vector of class "numeric" or "integer" with (life-)time observations.

s

An optional vector of right-censored data, or suspensions.

interval

An optional dataframe of interval data having columns specifically named "left" and "right". Left values are the last time at which no failure was evident and may be zero for discovery. Right values are the earliest time at which failure was observed.

...

Graphical options for plotting the wblr object. See section "Details" for other data passing arguments.

Details

There are several methods to passing arguments for building an wblr object.

  • If argument x is of class "data.frame", then it must contain $time and $event columns. Additional columns in the dataframe will be ignored.

  • When a single unnamed vector of class "numeric" or "integer" is supplied, it is treated as a vector of (life-)time observations.

  • If argument time or fail is provided, it is treated as a vector of (life-)time observations. Take care NOT to supply both time and fail in the same function call.

  • If argument event is provided, it is treated as a vector of event indicators with possible values of 0 and 1. See section "Value" for more details on event vectors.

  • If the x argument is not provided as a dataframe and susp is provided, it is treated as a vector of right-censored (life-)time observations (also called suspended observations or suspensions).

wblr always generates (probability) plot positions for graphically displaying the (life-)time observations and for (possible) later usage by wblr.fit. The following optiona arguments are most appropriate for passing in with wblr:

dist

A character string defining the distribution target. When used to establish the basis for contour mapping (without using wblr.conf with method.conf="lrb") only "weibull" (default) and "lognormal" are recognized.
Also used with wblr.fit for specific fitting control.

pp

Plotting position method, it is a character string describing the method of determining vertical plot positions. Implemented methods are "median" (default), "benard","hazen","mean", "kaplan-meier", and "blom".

rank.adj

The method employed for determining rank of failures when suspensions (right censored data) are present in the data set. Implemented methods are "johnson" (default) and "KMestimator".

ties.handler

The method employed for handling duplicate values in the data set.
Implemented methods are "none" (default) "highest", "lowest", "mean", and "sequential".
It is expected that ties handling will be applied to large data sets that will be fitted using the maximum likelihood estimation method, where the effect is only on the graphical presentation. Employing a ties handler on a rank regression model will effectively remove data from the data set, which is likely not intended.
Use of simply ties as an argument to function wblr will silently be accepted as ties.handler.

Options for graphical control over data points see par
  • pch Point choice defaults to 1. For more info, see points.

  • cex.points Point size defaults to 1.

  • lwd.points Line width defaults to 2.

Independent graphical control over interval lines
  • interval.col Color defaults to "black".

  • interval.lty Line type, defaults to "dashed".

  • interval.lwd Line width defaults to 1.

Subsequent calls to wblr.fit and wblr.conf will inherit these options.

Value

A named list of class "wblr". The first list item ($data) is a list with up to least three items:

$lrq_frame

A dataframe containing the provided data formatted with "left", "right", and "qty" columns. This is the output of WeibullR function "mleframe".

$data$dpoints

A dataframe contianing graphical data for exact failure point with their probability plotting positions and adjusted ranks.

$data$dlines

If interval data has been provided this dataframe will contain the graphical data for display similar to $data$dpoints, but with endpoints t1 and t2 for the interval.

References

William Q. Meeker and Luis A. Escobar, (1998) "Statistical Methods for Reliability Data", Wiley-Interscience, New York

Robert B. Abernethy, (2008) "The New Weibull Handbook, Fifth Edition"

John I. McCool, (2012) "Using the Weibull Distribution: Reliability, Modeling and Inference"

Jurgen Symynck, Filip De Bal, Weibull analysis using R, in a nutshell (New Technologies and Products in Machine Manufacturing Technology, Stefan cel Mare University of Suceava, 2010).

Examples

## These code lines all generate the same object ##
wblr(c(500,1200,900,1300,510))
wblr(time=c(500,1200,900,1300,510))
## this input format works, but not recommended.
wblr(time=c(500,1200,900,1300,510),event=c(1,1,1,1,1))
wblr(fail=c(500,1200,900,1300,510))
wblr(fail=c(500,1200,900,1300,510),susp=c())
da1 <- data.frame(
    serial=c("S12","S16","S17","S3","S5"),
    time=c(500,1200,900,1300,510),
    event=c(1,1,1,1,1))
## it is best practice set named objects
obj1 <- wblr(da1,label="complete dataset",pch=3,col="orange3")
obj2 <- wblr(da1,label="complete dataset",pch=4,pp="benard",col="red")


## Generate a similar dataset, but with suspensions ##
wblr(time=c(500,1200,900,1300,510),event=c(1,1,1,0,0))
wblr(data.frame(time=c(500,1200,900,1300,510),event=c(1,1,1,0,0)))
wblr(fail=c(500,1200,900),susp=c(1300,510))
wblr(time=c(500,1200,900),susp=c(1300,510))
da3 <- wblr(fail=c(500,1200,900,1300,510),
    event=c(1,1,1,0,0),label="censored dataset",pch=1,col="blue")

## plot datasets ##
## Not run: 
plot.wblr(list(da1,da3))

## End(Not run)


WeibullR documentation built on June 26, 2022, 1:06 a.m.