R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,20,20,20,20,20,20,20,20,21,21,21,22,22,22,22,22,22,22,23,23,23,24,24,24,25,25,26,26,30,30,30,30,31,31,32,32,33,34,34,34,34,36) > par2 = '1.5' > par1 = '0.1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(MASS) > PPCC <- function(meanlog, sdlog, x) + { + x <- sort(x) + pp <- ppoints(x) + cor(qlnorm(pp, meanlog=meanlog, sdlog=sdlog), x) + } > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > if (par1 < 0.1) par1 <- 0.1 > if (par1 > 50) par1 <- 50 > if (par2 < 0.1) par2 <- 0.1 > if (par2 > 50) par2 <- 50 > par1h <- par1*10 > par2h <- par2*10 > sortx <- sort(x) > c <- array(NA,dim=c(par2h)) > for (i in par1h:par2h) + { + c[i] <- cor(qlnorm(ppoints(x), meanlog=0,sdlog=i/10),sortx) + } > postscript(file="/var/www/html/rcomp/tmp/1po2q1272477987.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot((par1h:par2h)/10,c[par1h:par2h],xlab='sdlog',ylab='correlation',main='PPCC Plot - Lognormal') > dev.off() null device 1 > (f<-fitdistr(x, 'lognormal')) meanlog sdlog 2.43713205 0.54830259 (0.03730727) (0.02638022) > xlab <- paste('Lognormal(meanlog=',round(f$estimate[[1]],2)) > xlab <- paste(xlab,', sdlog=') > xlab <- paste(xlab,round(f$estimate[[2]],2)) > xlab <- paste(xlab,')') > postscript(file="/var/www/html/rcomp/tmp/2ig1t1272477987.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqplot(qlnorm(ppoints(x), meanlog=f$estimate[[1]], sdlog=f$estimate[[2]]), x, main='QQ plot (Lognormal)', xlab=xlab ) > grid() > dev.off() null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Parameter',1,TRUE) > a<-table.element(a,'Estimated Value',1,TRUE) > a<-table.element(a,'Standard Deviation',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'meanlog',header=TRUE) > a<-table.element(a,f$estimate[1]) > a<-table.element(a,f$sd[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'sdlog',header=TRUE) > a<-table.element(a,f$estimate[2]) > a<-table.element(a,f$sd[2]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3lgzz1272477987.tab") > > try(system("convert tmp/1po2q1272477987.ps tmp/1po2q1272477987.png",intern=TRUE)) character(0) > try(system("convert tmp/2ig1t1272477987.ps tmp/2ig1t1272477987.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.554 0.317 0.836