comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: significance of a linear regression
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: significance of a linear regression [message #53365] Sat, 07 April 2007 12:06
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
To follow-up my own posting, I think this is what you want. This
has been minimally tested (i.e., I wrote it today), so use at your
own risk.

http://idl.tamu.edu/downloads/correlation_significance_kpb.p ro

Cheers, Ken
Re: significance of a linear regression [message #53367 is a reply to message #53365] Sat, 07 April 2007 08:39 Go to previous message
Kenneth Bowman is currently offline  Kenneth Bowman
Messages: 86
Registered: November 2006
Member
In article <1175936871.328589.124530@b75g2000hsg.googlegroups.com>,
"jochem.verelst@gmail.com" <jochem.verelst@gmail.com> wrote:

> Though, I already figured out the CORRELATE function and keyword.
> However, this is not exactly what i meant. Although it is recognized
> that the R-square statistic is a better measure of the strength of
> relationship, from the F-test, at least in SPSS, the significance
> value (p) can be calculated. When it is smaller than 0.05, then the
> variation explained by the model is not due to chance. I wish to
> calculate this significance because then I have an automated threshold
> to decide whether a relationship is valid.
>
> Hopefully there is an easy way to calculate the significance.

It is, perhaps, unfortunate that REGRESS or CORRELATE do not compute the
statistical significances via keywords, but you can test the hypothesis
that rho = 0 by using the fact that r*SQRT(n-2)/SQRT(1.0 - r^2) follows
the t-distribution with n-2 degrees of freedom.

Here's a web page that you can use to check your calculation

http://www.met.rdg.ac.uk/cag/stats/corr.html

Ken Bowman
Re: significance of a linear regression [message #53370 is a reply to message #53367] Sat, 07 April 2007 02:07 Go to previous message
jochem.verelst@gmail. is currently offline  jochem.verelst@gmail.
Messages: 19
Registered: January 2007
Junior Member
On Apr 7, 5:34 am, Craig Markwardt
<craigm...@REMOVEcow.physics.wisc.edu> wrote:
> "jochem.vere...@gmail.com" <jochem.vere...@gmail.com> writes:
>> Hi IDL gurus,
>
>> I am much in favor of the IDL way, but being a newbie, it still causes
>> me big headache.
>
>> So this is the question:
>
>> Just as in SPSS, I wanted calculate the significance of linear
>> regression. The function REGRESS is very handy, as it also provides
>> the F-value by means of the keyword FTEST. Luckily this is the same F-
>> value as calculated in SPSS ( I just tested). However, SPSS also
>> provides the congruent p-value. And this is what matters to have an
>> idea of the significance. REGRESS does not provide such a keyword. So,
>> has anyone an idea how to calculate the significance of a linear
>> regression?
>
> I'm not sure what a "congruent p-value" is, but if you mean the
> Pearson's correlation coefficent, then you can use the standard
> CORRELATE() function. But surely that must be the same as the R value
> returned by REGRESS()?
>
> Craig
>
> --
> ------------------------------------------------------------ --------------
> Craig B. Markwardt, Ph.D. EMAIL: craigm...@REMOVEcow.physics.wisc.edu
> Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
> ------------------------------------------------------------ --------------- Hide quoted text -
>
> - Show quoted text -

Thanks for the info Craig,
Though, I already figured out the CORRELATE function and keyword.
However, this is not exactly what i meant. Although it is recognized
that the R-square statistic is a better measure of the strength of
relationship, from the F-test, at least in SPSS, the significance
value (p) can be calculated. When it is smaller than 0.05, then the
variation explained by the model is not due to chance. I wish to
calculate this significance because then I have an automated threshold
to decide whether a relationship is valid.

Hopefully there is an easy way to calculate the significance.

Jochem
Re: significance of a linear regression [message #53374 is a reply to message #53370] Fri, 06 April 2007 20:34 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"jochem.verelst@gmail.com" <jochem.verelst@gmail.com> writes:
> Hi IDL gurus,
>
> I am much in favor of the IDL way, but being a newbie, it still causes
> me big headache.
>
> So this is the question:
>
> Just as in SPSS, I wanted calculate the significance of linear
> regression. The function REGRESS is very handy, as it also provides
> the F-value by means of the keyword FTEST. Luckily this is the same F-
> value as calculated in SPSS ( I just tested). However, SPSS also
> provides the congruent p-value. And this is what matters to have an
> idea of the significance. REGRESS does not provide such a keyword. So,
> has anyone an idea how to calculate the significance of a linear
> regression?

I'm not sure what a "congruent p-value" is, but if you mean the
Pearson's correlation coefficent, then you can use the standard
CORRELATE() function. But surely that must be the same as the R value
returned by REGRESS()?

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: convert hex string to ascii
Next Topic: Re: convert hex string to ascii

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:36:42 PDT 2025

Total time taken to generate the page: 0.00670 seconds