help-octave
[Top][All Lists]
Advanced

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

Re: Confidence-intervall for correlation?


From: Muhali
Subject: Re: Confidence-intervall for correlation?
Date: Sat, 22 Oct 2011 14:34:31 -0700 (PDT)

stn wrote:
> 
> # korr_int( r , n , alpha )
> # F() and Finv() are the fisher-transformation and -retransformation
> 
> function F    = F(r)      ; F    = log( (1+r)/(1-r)  ) / 2 ; end
> function Finv = Finv(z)   ; Finv = ( ( exp(2*z) - 1 ) / ( exp(2*z) + 1 ) )
> ;
> end
> function [lb ub] = korr_int(r , n , alpha)
>   # fisher-transform of r
>   Z      = F(r) ;
>   # width of the the confidence-interval for Z
>   DZ     = norminv(1-((1-alpha)/2));
>   DZ     = DZ / sqrt(n-3);
>   # calculate lower and upper bound of interval, retransform to original
> distribution
>   lb     = Z - DZ  ; lb = Finv(lb) ;
>   ub     = Z + DZ  ; ub = Finv(ub) ;
> end
> 
looks good to me. Could you provide an appropriate changeset for the
corresponding corrcoef function? You would need to adjust the korr_int
function to accept matrices as input. And you may want to take a look at 
http://savannah.gnu.org/bugs/?33541 this .

M.


--
View this message in context: 
http://octave.1599824.n4.nabble.com/Confidence-intervall-for-correlation-tp3907631p3929080.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]