;+ ; .. _significance_test_99.pro: ; ; ======================== ; significance_test_99.pro ; ======================== ; ; DESCRIPTION ; =========== ; ; SEE ALSO ; ======== ; ; :ref:`project_profile.sh` ; ; :ref:`fig10_swr_correction.pro` ; :ref:`fig4_met_var_correction_scatter.pro` ; ; EXAMPLES ; ======== ; ; :: ; ; IDL> @project_init ; IDL> x=++ ; IDL> y=++ ; IDL> sig_value=++ ; IDL> significance_test_99, x, y, sig_value ; ; TODO ; ==== ; ; coding rules ; ; complete description ; ; complete example ; ; EVOLUTIONS ; ========== ; ; $Id$ ; ; $URL$ ; ; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * minimal header ; ;- pro significance_test_99, x, y, sig_value X=x & Y=y X=X-total(X)/n_elements(X) Y=Y-total(Y)/n_elements(Y) sx=stdev(X) sy=stdev(Y) reg=correlate(X,Y)*sy/sx sse=total((Y-reg*X)^2)/n_elements(X) t=abs(sqrt(n_elements(X)-2.)*reg/sqrt(sse/sx^2)) p=0.01 ;;;(for 99% significant) ; tc=t_cvf(p/2.,n_elements(X)-1) tc=t_cvf(p/2.,n_elements(X)/5.-1) sig1=1.*(t ge tc) if (sig1 eq 1. ) then begin print, 'Statistics are valid at 99% significance level' endif else begin print, 'Statistics are not valid at 99% significance level' endelse end