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

Re: Equivalent of EXCEL LINEST function?




Bruce Bowler <bbowler@bigelow.org> writes:
> I wanted to regress 2 vectors so I go into the online help in 5.3 (which
> is what I'm using) and type regress.  Up pops the REGRESS function.  No
> where does the REGRESS help mention LINFIT or CORRELATE.

I agree, I was a little surprised that the REGRESS docs didn't mention
LINFIT, since LINFIT is the degenerate case of one dimension.

> After "rolling my own", I find them and they do (almost) what I want. 
> They don't (like LINEST in excel, or "my own") provide standard errors
> of the coefficents, the constant and Y estimate and a few other little
> bits.

Umm, here I think I have to disagree.  The SIGMA keyword provides the
errors of the coefficients, as my example showed.  The R^2 constant is
directly from CORRELATE, so I'm not sure your complaint here.  And
finally,

  YFIT = A*X + B

Sometimes things are simple enough that having a canned procedure to
do them is overkill. :-)

Craig

-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------