Re: regression coefficient

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sat Jan 12 2013 - 10:59:23 MST

You do not "calculate (a) regression coefficient at (the) 95%
confidence level." You [1] calculate a regression coefficient;
then [2] test against the null hypothesis.

The example you sent is ambiguous.
What do printVarSummary(x) and printVarSummary(y) yield

If x(time,lat,lon) and y(time,lat,lon) then

    rc = regCoef(x(lat|:,lon|:,time|:),y(lat|:,lon|:,time|:))

    rc!0 = "lat" ; name dimensions
    rc!1 = "lon"
    rc&lat = y&lat" ; assign coordinate values to named dimensions
    rc&lon = y&lon"

    df = rc@nptxy-2 ; degrees of freedom
    tval = rc@tval ; t-statistic
    b = tval ; b must be same size as tval (and df)
    b = 0.5
    prob = betainc(df/(df+tval^2),df/2.0,b)

   ;copy_VarCoords(rc,prob)
   ;prob@long_name = "probability"
   ;prob@units = "fraction: [0,1]"

   rc95 = where(prob.lt.0.95,rc@_FillValue,rc) ; **** note 0.95 ****
   copy_VarCoords(rc, rc95)
   printVarSummary(rc95)

On 1/11/13 6:36 AM, Xi Chang wrote:
> Thanks for the response,
> I think my way (codes) to calculate is still wrong.
> Does anyone here has experince how to calculate regression coefficient
> at 95% confidence level?
>
> I will really really appreciate if anyone can share their experience how to
> calculate
> it here.
>
> Regards,
> Xi Chang.
>
>
>
>
> On Fri, Jan 11, 2013 at 1:09 PM, Mary Haley <haley@ucar.edu> wrote:
>
>> Dear Xi,
>>
>> The error message is telling you that your argumens to the "where"
>> function do not have the correct dimensions.
>>
>> In order to use the "where" function, he second and third arguments must
>> either be the same dimensionality as the first argument, or else be scalars.
>>
>> My guess is that since "rc@_FillValue" is likely a scalar, and is
>> probably okay, then "rc" is not the same dimensionality as "prob".
>>
>> -Mary
>>
>>
>> On Jan 7, 2013, at 9:14 AM, Xi Chang wrote:
>>
>>> I really need a help, I want to plot the regression coeff at 95%
>> confidence limit in 2D map.
>>> ---[snip]
>>> x = ispan(0,dimsizes(trmm&time)-1,1)*1.
>>> rc = regCoef(x,trmm)
>>> df = rc@nptxy-2 ; degrees of freedom
>>> tval = rc@tval ; t-statistic
>>> b = tval ; b must be same size as tval (and df)
>>> b = 0.5
>>> prob = (1 - betainc(df/(df+tval^2),df/2.0,b) )
>>> copy_VarCoords(rc,prob)
>>> rc95 = where(prob.lt.95,rc@_FillValue,rc)
>>> --[snip]
>>> plot = gsn_csm_contour_map_ce(wks,rc,res)
>>>
>>> but i got an error:
>>> fatal:where: condition variable (parameter 1) dimension mismatch with
>> parameter 2
>>>
>>> Anybody can give me some suggestions or maybe the codes are not correct
>> (?).
>>>
>>> Thanks,
>>> Xi Chang.
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Jan 12 10:59:35 2013

This archive was generated by hypermail 2.1.8 : Mon Jan 14 2013 - 14:31:38 MST