Re: confidence intervals

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 30 2010 - 11:41:17 MDT

  Hi Debasish,

  You can use
  http://www.ncl.ucar.edu/Document/Functions/Built-in/rtest.shtml

  The key is "Nr". If the variable is precipitation, the number of
  independent samples is (generally) the sample size.

  To plot, you can

  gsn_define_colormap(wks, "ViBlGrWhYeOrRe")
  or
  gsn_define_colormap(wks, "nrl_sirkes")
  or
  gsn_define_colormap(wks, "ViBlGrWhYeOrRe")
  or
  gsn_define_colormap(wks, "amwg")

  res@gsnSpreadColors = True

  or
  name your own colors

  res@cnLevelSelectionMode = "ExplicitLevels"
  res@cnLevels = (/-99, -95, -90, 0, 90, 95, 99 /)

Good luck
  D
>>
>> Debasish PaiMazumder wrote:
>>> Dear Dennis,
>>> I would like to calculate significant region for different confidence
>>> levels as mention in my last post.
>>> For example: I have tow variable x(time,lat,lon) and y(time,lat,lon)
>>> and their correlation cor(lat,lon). Now I want to calculate
>>> significant of these correlation at different confidence level as
>>> variable sig(lat,lon). where sig(0,0)=95% ; at gridcell (lat=0, and
>>> lon=0) correlation between x, y is positive and significant at 95%
>>> confidence interval sig(0,1)=-99% ;at gridcell (lat=0, and lon=1)
>>> correlation between x, y is negative and significant at 99%
>>> confidence interval and so on. So that I can plot sig(lat,lon) like
>>> attached plot. Is there any script in NCL that can help me to solve
>>> this problem.
>>> sorry for any inconvenience
>>> Thank you so much for your help
>>> Debasish
>>> =
>>> ------------------------------------------------------------------------
>>> Begin forwarded message:
>>>> *From: *Mary Haley <haley@ucar.edu <mailto:haley@ucar.edu>>
>>>> *Date: *24 mars 2010 12:54:11 HAE
>>>> *To: *Debasish PaiMazumder <debasish@sca.uqam.ca
>>>> <mailto:debasish@sca.uqam.ca>>
>>>> *Cc: *Dennis Shea <shea@ucar.edu <mailto:shea@ucar.edu>>
>>>> *Subject: **Re: [ncl-talk] confidence intervals*
>>>>
>>>>
>>>> Hi Debasish,
>>>>
>>>> I think Dennis might be able to answer the question better about
>>>> calcuating the significant region for different confidence levels.
>>>> I've CC'ed him.
>>>>
>>>> The only function that I see that mentions "confidence" is specx_ci".
>>>>
>>>> --Mary
>>>>
>>>> On Mar 23, 2010, at 10:44 AM, Debasish PaiMazumder wrote:
>>>>
>>>>> Dear Mary,
>>>>>
>>>>> Sorry about the miscommunication. I know that the attached plot is
>>>>> basic contour plot. Actually I know how to plot the correlation
>>>>> contour with shaded or colored significant region at 95% confidence
>>>>> level (as mentioned in example 4) . I guess that attached plot
>>>>> shows the positively or negatively significant region at various
>>>>> confidence intervals (-99% -95% -90% 90% 95% 99%) instead of
>>>>> correlation.
>>>>>
>>>>> suppose I have tow variable x(time,lat,lon) and Y(time,lat.lon). I
>>>>> know how to calculate the correlation (cor(lat,lon)) between these
>>>>> two variables and the significant of this correlation (using rtest)
>>>>> at particular interval. I would like to know is there any script in
>>>>> NCL that can calculate the significant region for different
>>>>> confidence interval as a variable sig(lat,lon).
>>>>>
>>>>> example: sig(0,0)=95% ; at gridcell (lat=0, and lon=0) correlation
>>>>> between x, y is positive and significant at 95% confidence interval
>>>>> sig(0,1)=-99% ;at gridcell (lat=0, and lon=1) correlation between
>>>>> x, y is negative and significant at 99% confidence interval
>>>>> and so on...
>>>>> and then I can plot the sig(lat,lon)
>>>>>
>>>>> Or I can do the plot using example 4 (
>>>>> http://www.ncl.ucar.edu/Applications/conOncon.shtml) plot2 =
>>>>> gsn_csm_contour(wks,gsn_add_cyclic_point(prob(:,:,0)), res2) plot2
>>>>> = ShadeLtContour(plot2, 0.07, 17) ; shade all areas less than the
>>>>> ; 0.05 contour level
>>>>>
>>>>> and change the value insides of ShadeLtContour to get different
>>>>> contour level. I do not know it is a good way or not.
>>>>>
>>>>> Please let me know if have any difficulties to understand the problem.
>>>>>
>>>>> Thanks
>>>>>
>>>>> Debasish
>>>>>
>>>>> On 10-03-23, at 11:47, Mary Haley wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Is there something different about this plot other than being a
>>>>>> basic contour plot that I'm missing?
>>>>>> In other words, do you need routines for doing the calculations as
>>>>>> well.
>>>>>>
>>>>>> This plot looks like a raster plot. See:
>>>>>>
>>>>>> http://www.ncl.ucar.edu/Applications/raster.shtml
>>>>>>
>>>>>> --Mary
>>>>>>
>>>>>> On Mar 23, 2010, at 9:02 AM, Debasish PaiMazumder wrote:
>>>>>>
>>>>>>> Offline....
>>>>>>>
>>>>>>> Dear Mary,
>>>>>>>
>>>>>>> Thanks for your response. I would like draw a plot similar to the
>>>>>>> attached plot.
>>>>>>>
>>>>>>> Thanks again
>>>>>>>
>>>>>>> Debasish
>>>>>>>
>>>>>>> <confidence_interval.pdf>
>>>>>>>
>>>>>>> On 10-03-23, at 09:34, Mary Haley wrote:
>>>>>>>
>>>>>>>> Are you looking for something like example 4 or 8 on:
>>>>>>>>
>>>>>>>> http://www.ncl.ucar.edu/Applications/conOncon.shtml
>>>>>>>>
>>>>>>>> --Mary
>>>>>>>>
>>>>>>>> On Mar 22, 2010, at 10:17 AM, Debasish PaiMazumder wrote:
>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> I would like to draw a spatial plot of significance correlation
>>>>>>>>> in terms of confidence intervals (i.e. color label should be
>>>>>>>>> -99 -95 -90 90 -95 -99%). Is there any example in ncl which do
>>>>>>>>> the same?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> Debasish
>>>>>>>>>
>>>>>>>>> Debasish PaiMazumder, PhD
>>>>>>>>> Postdoctoral Researcher Analysis and Simulation of
>>>>>>>>> Regional-Scale Climate
>>>>>>>>> Department of Earth and Atmospheric Sciences
>>>>>>>>> University of Québec at Montréal (UQÀM)
>>>>>>>>> 550, Sherbrooke west, 19th floor, west tower,
>>>>>>>>> Montréal, QC, Canada H3A 1B9
>>>>>>>>> Tel: (514) 282-6464-343
>>>>>>>>> (514) 937-0042 (R)
>>>>>>>>> email: debasish@sca.uqam.ca <mailto:debasish@sca.uqam.ca>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> ncl-talk mailing list
>>>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>>>
>>>>>>>
>>>>>>> Debasish PaiMazumder, PhD
>>>>>>> Postdoctoral Researcher Analysis and Simulation of Regional-Scale
>>>>>>> Climate
>>>>>>> Department of Earth and Atmospheric Sciences
>>>>>>> University of Québec at Montréal (UQÀM)
>>>>>>> 550, Sherbrooke west, 19th floor, west tower,
>>>>>>> Montréal, QC, Canada H3A 1B9
>>>>>>> Tel: (514) 282-6464-343
>>>>>>> (514) 937-0042 (R)
>>>>>>> email: debasish@sca.uqam.ca <mailto:debasish@sca.uqam.ca>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>> Debasish PaiMazumder, PhD
>>>>> Postdoctoral Researcher Analysis and Simulation of Regional-Scale
>>>>> Climate
>>>>> Department of Earth and Atmospheric Sciences
>>>>> University of Québec at Montréal (UQÀM)
>>>>> 550, Sherbrooke west, 19th floor, west tower,
>>>>> Montréal, QC, Canada H3A 1B9
>>>>> Tel: (514) 282-6464-343
>>>>> (514) 937-0042 (R)
>>>>> email: debasish@sca.uqam.ca <mailto:debasish@sca.uqam.ca>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>> Debasish PaiMazumder, PhD
>>> Postdoctoral Researcher Analysis and Simulation of Regional-Scale
>>> Climate
>>> Department of Earth and Atmospheric Sciences
>>> University of Québec at Montréal (UQÀM)
>>> 550, Sherbrooke west, 19th floor, west tower,
>>> Montréal, QC, Canada H3A 1B9
>>> Tel: (514) 282-6464-343
>>> (514) 937-0042 (R)
>>> email: debasish@sca.uqam.ca <mailto:debasish@sca.uqam.ca>
>>> =

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 30 11:41:22 2010

This archive was generated by hypermail 2.1.8 : Wed Apr 07 2010 - 07:12:50 MDT