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

Re: Equivalent of EXCEL LINEST function?



So it is... now for "stupid question #347" (tm).

How do I turn a vector (which is what I have for x) into an array?

	help, x
	x		float		= array[12345]
	help, y
	y		float		= array[12345]
	weight = replicate(1.0,n_elements(y))
	help, weight
	weight		float		= array[12345]
	result = regress(x,y,weight,/relative_weight)
	% REGRESS: Incompatable arrays.

Looking at the code for regress, the only condition I violate to cause
that message is that my X is only 1 dimenesion, not 2...

Hey it's late Friday and my brain is mush, I can't see straight, and my
back hurts, what can I say???

Bruce

Med Bennett wrote:
> 
> I believe the IDL function is REGRESS or REGRESSION, I haven't checked
> lately though.
> 
> Bruce Bowler wrote:
> 
> > I'm probably just having a brain cramp but I can't figure out how to do
> > something that seems as simple as the EXCEL function LINEST.
> >
> > Basically, I have an X vector and a Y vector and I want to find the
> > linear "best fit" function, the r^2 of that fit, and the standard errors
> > of all the parameters.  (I could do it all by writing my own routines,
> > but I'm *SURE* that someone has already done it, you know, steal from
> > your friends :-)
> >
> > Thanks!
> > Bruce