Skip to content
Back to formatted view

Raw Message

Message-ID: <tencent_54BBFE453A5A22471530ADEE@qq.com>
Date: 2016-05-26T04:43:27Z
From: Jessica Wang
Subject: R help- fit distribution "fitdistr"

Hello, I just start using R. I want to use ?fitdistr? to fit distribution of the data. Then how can I verify if the data really fit the distribution? Thanks [data is attached]
 
res<-fitdistr(data$Report.delay, "Poisson") 
 
h<-hist(data$Report.delay) 
 
xfit<-floor(seq(0, 250, 50)) 
 
yfit<-dpois(xfit,res[[1]][1]) 
 
yfit<-yfit*diff(h$mids[1:2])*length(xfit) 
 
lines(xfit, yfit, col="blue", lwd=2)