Hi All, What I would like to do is the following: a) fit a probability function to a measured data set. This would be user specified, e.g., normal, lognormal, etc. and then b) take the probability function and plot it with the histogram of the measured data set. This function would be displayed as a smooth curve. This would involve "re-sizing" the probability function to match that of the measured data set. For those who are interested, I can send a postscript, pdf and a gif file to illustrate what I am looking to achieve (I have been advised not to send attachments to mailing lists). Also I have a package which produces a jittered, one-dimensional scatter plot to show the relationship of the histogram to the original data (This is plotted underneath the histogram) .The X-axis contains the actual data values. The y-axis is entirely random. Is it also possible to do this in R. Again I can send the relevant files to interested parties on an individual basis. Thanks in advance, Dermot MacSweeney ************************************************************** Dermot MacSweeney NMRC, Email: dsweeney at nmrc.ucc.ie Lee Maltings, Tel: +353 21 904178 Prospect Row, Fax: +353 21 270271 Cork, WWW: http://nmrc.ucc.ie Ireland ************************************************************** -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dermot MacSweeney <dsweeney at nmrc.ucc.ie> writes:> Hi All, > > What I would like to do is the following: > > a) fit a probability function to a measured data set. This would be user > specified, e.g., normal, lognormal, etc. > > and then > > b) take the probability function and plot it with the histogram of the > measured data set. This function would be displayed as a smooth curve. This > would involve "re-sizing" the probability function to match that of the measured > data set.Try this for a start: hist(rnorm(100),freq=F) curve(dnorm(x),add=T) This gets the units right. The main trouble is that the curve often overshoots, so that you need to diddle the ylim and maybe also xlim on the hist() call.> Also I have a package which produces a jittered, one-dimensional scatter plot to > show the relationship of the histogram to the original data (This is plotted > underneath the histogram) .The X-axis contains the > actual data values. The y-axis is entirely random. Is it also possible to do > this in R. Again I can send the relevant files to interested parties on an > individual basis.stripplot(x,method="jitter") for a starting point. To get the coordination between the two plots make sure they have the same xlim and use layout() to display them on top of eachother. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._