Reputation:
I am trying to create a base plot for a weibull probability plot. I have been exploring the survival
package in R but have not found the exact tool I need yet. So far I have been able to recreate the plot I need by hand (which is terrible - tons of hard coding, it is not flexible at all and looks terrible).
My guess is that there is a package to create this base graph, with the grid lines, I just haven't discovered it yet.
This image is what I need to graph, it is called "Weibull probability plotting paper"
Is there a way in ggplot2
or within the survival
package (or anything other that base R graphics) to create this plot? From there, I can overlay the points.
Please keep in mind the graphics I create in the end will need to be compatible with Shiny
. Thank you.
For reference this is the ugly plot I have managed to create using ggplot2
by hand.
Also, please note I cannot provide a reproducible code example since this is a very complex problem, I am looking for a basic reproducible base plot.
UPDATE
I am looking for a what to produce this plot, here is some examples of how I created mine by hand, please note it is not fully reproducible.
Here is how I set up the y-axis tick marks:
yticks <- c(log(-log(1-0.0001)), log(-log(1-0.001)), log(-log(1-0.005)), log(-log(1-0.010)), log(-log(1-0.05)), log(-log(1-0.10)),
log(-log(1-0.50)), log(-log(1-0.90)), log(-log(1-0.99)))
Here are the y-labels:
ylabs <- c('0.01','0.1','0.5','1','5','10','50','90','99')
Here is how to create the minor grid lines:
yminorticks <- c(
log(-log(1-0.00001)),log(-log(1-0.00002)),log(-log(1-0.00003)),log(-log(1-0.00004)),log(-log(1-0.00005)),log(-log(1-0.00006)),log(-log(1-0.00007)),log(-log(1-0.00008)),log(-log(1-0.00009)),
log(-log(1-0.0001 )),log(-log(1-0.0002)),log(-log(1-0.0003)),log(-log(1-0.0004)),log(-log(1-0.0005)),log(-log(1-0.0006)),log(-log(1-0.0007)),log(-log(1-0.0008)),log(-log(1-0.0009)),
log(-log(1-0.001)),log(-log(1-0.002)),log(-log(1-0.003)),log(-log(1-0.004)),log(-log(1-0.005)),log(-log(1-0.006)),log(-log(1-0.007)),log(-log(1-0.008)),log(-log(1-0.009)),
log(-log(1-0.01)),log(-log(1-0.02)),log(-log(1-0.03)),log(-log(1-0.04)),log(-log(1-0.05)),log(-log(1-0.06)),log(-log(1-0.07)),log(-log(1-0.08)),log(-log(1-0.09)),
log(-log(1-0.10)),log(-log(1-0.20)),log(-log(1-0.30)),log(-log(1-0.40)),log(-log(1-0.50)),log(-log(1-0.60)),log(-log(1-0.70)),log(-log(1-0.80)),log(-log(1-0.90)))
Upvotes: 2
Views: 2732
Reputation: 137
There is a package weibullR
, which will help you to plot unreliability vs time.
library(WeibullR)
df <- data.frame(time = c(10000, 10000, 20000, 20000, 30000, 30000, 30000, 30000,
40000, 50000, 50000, 60000, 70000, 70000, 70000, 70000,
80000, 80000, 80000, 80000, 90000, 90000, 100000),
event = rep(1, 23))
weibl <- 1- wblr(df,
col="darkgreen",
label="censored dataset",
dist = "weibull2p",
ylab = "check")
weibl_fit <- wblr.fit(weR, col = "Red", method.fit = "rr")
data <- wblr.conf(weibl_fit, col="blue")
plot(data)
Upvotes: 1