Re: ttest......

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu, 03 Sep 2009 09:49:48 -0600

Hello,
(Hopefully this answers both of your ncl-talk queries.)
Typically when I am using the ttest routine, and plotting only those
values that are significant to the 95% level my coding looks something
like this:

probt = 100.*(1. -ttest(r_ave1,r_var1,sX_r,r_ave2,r_var2,sY_r, True,
False)) ; all areas whose value > 95 are significant
aveX = where(probt.lt.95.,aveX@_FillValue, aveX)

If there are large areas of the map that are not significant (=missing),
you might want to change your cnFillMode to CellFill or RasterFill, so
that all the grid boxes that are significant show up in your plot.
Best regards,
Adam

Sabeerali(sebi) wrote:
> Hello support
>
> I want to do the ttest of composite anomaly. My null hypothesis is
> composite anomaly is not statistically significant. . The variable
> "JJAS_olr_anom_E" is having dimension lat=73,lon=144,time=4. The
> variable "JJAS_olr_anom_1983_05" is having dimension
> lat=73,lon=144,time=23. aveX, varX, aveY,varY is having dimension
> lat=73,lon=144
> so my sX=4, sY=23. I want to plot only statistically significant value
> only. Anybody can help me?
>
> Any help would be appreciated. I am attaching the script here
>
>
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> begin
> ;**************************************************************
> in2=addfile("mn_olr_1983-05.nc <http://mn_olr_1983-05.nc>","r")
> olr=in2->olr
> olrflt=short2flt(olr)
> mn_clim_olr=clmMonTLL(olrflt)
> ;printVarSummary(mn_clim_olr)
> Mon_olr_anom=calcMonAnomTLL(olrflt,mn_clim_olr)
> Mon_olr_anom@_FillValue=32767
> Mon_olr_anom_at_missing_value=32767
> ;*****************************************************
> ; significant test
> ;*********************************************************************
> four_month_runavg=runave_Wrap(Mon_olr_anom(lat|:,lon|:,time|:),4,0)
> JJAS_olr_anom_1983_05=four_month_runavg(:,:,6::12)
> ii=(/0,7,16,21/)
> JJAS_olr_anom_E = (/JJAS_olr_anom_1983_05(:,:,ii)/)
>
> siglvl=0.05
> aveX=dim_avg_n(JJAS_olr_anom_E,2)
> varX=dim_variance_n(JJAS_olr_anom_E,2)
> sX=4
> sY=23
> aveY=dim_avg_Wrap(JJAS_olr_anom_1983_05)
> varY=dim_variance_Wrap(JJAS_olr_anom_1983_05)
> iflag=True
> probt = ttest(aveX,varX,sX, aveY,varY,sY, iflag,False)
> aveX=mask(aveX,probt.lt.siglvl,True)
> copy_VarCoords(olr(0,:,:),aveX)
> ;***********************************************************************
> wks=gsn_open_wks("ps","test_composite")
> gsn_define_colormap(wks,"BlueRed")
> res=True
> res_at_cnFillOn=True
> res_at_gsnSpreadColors=True
> res_at_cnLinesOn=False
> plot=gsn_csm_contour_map_ce(wks,aveX,res)
> ;***********************************************************************
> end
>
> 14,1 Top
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Sep 03 2009 - 09:49:48 MDT

This archive was generated by hypermail 2.2.0 : Thu Sep 03 2009 - 21:03:38 MDT