[R] [FORGED] qqPlot vs qqcomp
mohsen hs
mohsenhs82 at yahoo.com
Tue Dec 22 07:30:11 CET 2015
Hi Rolf
Thank you for your reply and time.Please let me provide more information about my problem.
My data is like this (I obtained itwith the kind support of WCC), it shows the number of counted cars for eachinterval like this:
timenum,count
1,1800
2,1400
4,1000
..
1,86868
It means I had 1800 cars with theinterarrival time of 1 second. 1400 cars with the interarrival time of 2seconds, 1000 cars with the interarrival time of 4 seconds, and finally 1 carwith the interarrival time of 86868. Interarrival in this context means thetime (in seconds) between two consecutive arrivals at a sampling device (position).The purpose is to find the best distribution model which describes the intervaltime. Then do some censoring and compare the result (GOF and QQ plots) and comeup with the best possible model. So far, lnorm is the best one. However, thewhole code is this:
require(gglot2)
library(fitdistrplus)
df= read.csv ("E:/PathAll_TWOMONTH_BothDirection.csv")
z=rep(df$timenum,time=df$count)
serving<-z
fitln <- fitdist(serving,"lnorm",method="mle")
summary(fitln)
Fitting of the distribution ' lnorm' by maximum likelihood
Parameters :
estimate Std. Error
meanlog 3.936191 0.0011227470
sdlog 1.622471 0.0007939006
Loglikelihood: -12193668 AIC: 24387340 BIC: 24387365
Correlation matrix:
meanlog sdlog
meanlog 1.000000e+00 1.245201e-09
sdlog 1.245201e-09 1.000000e+00
> qqcomp(fitln)
Now, I would like to get the sameplot by using qqPlot command:
http://finzi.psych.upenn.edu/library/EnvStats/html/qqPlot.html
require(EnvStats)
qqPlot ( serving, dist ="lnorm", estimate.params = TRUE, add.line = TRUE)
The above command gives me a differentplot. I am not sure what part I am doing wrong. I appreciate your time forconsidering my request and your feedback is highly appreciated. Please find the plots attached. The right one is from qqcomp and the left one is from qqPlot. Titles might be incorrect.
Cheers
Mohsen
On Tuesday, December 22, 2015 4:52 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
On 18/12/15 22:57, mohsen hs via R-help wrote:
> Hello all I am using the following two commands and get two
> completely different qq plots while meanlog and sdlog are almost the
> same.
What are "meanlog" and "sdlog"? My telepathic capacity is severely
limited, and R's mind_read() function is still under development.
Any help is highly appreciated. dev.new() ; qqPlot(serving,
> dist = "lnorm", estimate.params = TRUE, add.line = TRUE)
> fitln <- fitdist(serving, "lnorm") dev.new();qqcomp(fitln)
There is no "qqPlot()" function in the automatically loaded packages in
R. There is a qqplot() function but it appears to have a different
argument list.
So where (what package) does qqPlot() come from?
And while you're at it, how about a *reproducible* example?
Please refrain from posting in HTML.
When you are seeking help, have the decency to express yourself in a
manner such that providing help is possible.
cheers,
Rolf Turner
--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276
More information about the R-help
mailing list