[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: Correlation on log-log? -or- Easy way of removing 0's?*From*: Craig Markwardt <craigmnet(at)cow.physics.wisc.edu>*Date*: 26 May 2000 10:17:43 -0500*Newsgroups*: comp.lang.idl-pvwave*Organization*: U. Wisc. Madison Physics -- Compact Objects*References*: <392E7F7C.9CDEDD62@mathstat.dal.ca>*Reply-To*: craigmnet(at)cow.physics.wisc.edu*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:19806

Simon de Vet <simon@mathstat.dal.ca> writes: > I have been creating scatter plots on a log-log graph, and they look > pretty good. > > However, I'd like some more accuracy than saying "pretty good". I tried > to use CORRELATE, and got some fairly reasonable values. However, since > CORRELATE is working with the pure data, scatters that look good on the > log-log plot can give some pretty horrendous correlation coefficients. > > Therefore, I thought I'd try doing a correlation of the log the data, to > get a better impression of what I'm seeing. Of the five data sets, 2 > gave better correlations, one got worse, and 2 gave me NaN's. > > I think that this may be because some of the values are 0, and this > makes my computer explode (metaphorically speaking, of course). Is there > an easy way of fixing this problem without loops? Could there be another > cause of my problem? This is a classic case of using WHERE to filter your data. wh = where(x GT 0 AND y GT 0, ct) if ct EQ 0 then message, 'ERROR: there are no valid points' x1 = x(wh) y1 = y(wh) plot, x1, y1, /xlog, /ylog, ... correlate, x1, y1, ... etc. Craig -- -------------------------------------------------------------------------- Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response --------------------------------------------------------------------------

**References**:**Correlation on log-log? -or- Easy way of removing 0's?***From:*Simon de Vet

- Prev by Date:
**Correlation on log-log? -or- Easy way of removing 0's?** - Next by Date:
**Re: ICUR Library** - Prev by thread:
**Correlation on log-log? -or- Easy way of removing 0's?** - Next by thread:
**Special symbols... Postscript .vs. Hershey fonts** - Index(es):