[ncl-talk] Question about regressing a time series and a gridded data using regCoef_n

Will Hobbs will.hobbs at utas.edu.au
Thu Jun 22 00:34:28 MDT 2017

```Change the dimensions of ‘prob’ so that it matches the dimensions of rc.

You can do this using the onedtond() function; you’ll find a complete description of this function on the NCL web page.

Will

From: <ncl-talk-bounces at ucar.edu> on behalf of Lyndon Mark Olaguera <olagueralyndonmark429 at gmail.com>
Date: Thursday, 22 June 2017 at 4:28 PM
To: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
Subject: [ncl-talk] Question about regressing a time series and a gridded data using regCoef_n

Dear NCL experts,

I am trying to calculate the linear regression coefficient between a single time series and a gridded sst using the regCoef_n in ncl. I am using ncl v.6.4.

Attached is my script and the text file that I am regressing. Here is the link to the sst data:

What I wanted to do:

1. I want to extract and plot significant coefficients (above 95% confidence level), so I have this line in the script:

df = rc at nptxy-2 ; degrees of freedom
tval = rc at 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)
rc95 = where(prob.lt.0.95,rc at _FillValue,rc)

I encountered an error after this:

fatal:where: condition variable (parameter 0) dimension mismatch with parameter 2

I understand that the "prob" variable has only one dimension and the "rc" has 2 dimensions (lat & lon).

Is it possible to assign coordinates to "prob" similar to "rc" other than the copyVarCoords?

I'll appreciate any suggestions on how to do this correctly.

Sincerely,

Lyndz

University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170622/c12502f5/attachment.html
```