QQ plot for censored data (interval)

#1
Dear All,

I am trying to fit my data to a distribution (say lognormal) in R with plotting QQ, and my data contains both right and left censoring. I highly appreciate that if you could provide me a sample, link, tutorial or anything. I also have access to SAS Educational.

Best regards
Mohsen
 
#3
Hi hlsmith

Thanks for your reply.

Please let me briefly explain the situation. We would like to model the traffic data and we collected the data from some devices. They were collected every 60 seconds (but not very accurately) and we distributed them by using uniform dist in 60 seconds randomly. We are interested to know what distribution model the data better.

Among all the distributions, lnorm fitted better and has the lowest AIC, BIC, but I can see a small tail both at the start and at the end (Values less than 2 seconds and values greater than 1000 sec). Hence, I would like to do the left censoring for val<2 and right for val>1000) and plot the QQ.

Looking forward to hearing from you.

Regards
M
 

hlsmith

Not a robit
#4
So you have fitted a linear reg and the residuals look fine? Now you are trying to see if some transformations may increase fit.
 
#5
No, I did not fit a linear regression. This is my code in R:
require(gglot2)
library(fitdistrplus)
library(MASS)
require(FAdist)
require(EnvStats)
df= read.csv ("data.csv")
z=rep(df$timenum,time=df$count)
fitln <- fitdist(z, "lnorm")
...
qqPlotCensored(z,as.logical(arr),distribution = "lnorm", censoring.side = "left",add.line = TRUE, main = "")

Unfortunately qqPlotCensored can do the fitting and QQ for only right or left and it does not have the ability to do it simultaneously. I am looking for a function or package to plot qq for both left and right at the same time.
 

hlsmith

Not a robit
#6
I guess what I was getting at was, what is the end purpose? What are you doing with these data. Truncating Data is usually a bold action.
 
#7
Thanks for your reply.

The purpose is to find the best distribution that model the data. I am not trying to truncate the data. I want to do censoring which I think is more reasonable. As you mentioned, I think I need a qq plot with Cox-Snell residual which follows the normative distribution as a tool for visualization.

Regards,