# Re: regression at each station

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 30 Jul 2009 15:30:12 -0600

Hello,

Assuming the the output from 'linint2_points' is (say)

fo(time,pts)

then

rc = regCoef ( x , fo(pts|:,time|:) )

Here "x" could be "time" or (say) ispan(1,ntim,1)

rc(754)

Good Luck

yanling_1220 wrote:
>
> I have a question about regression in the ncl.
>
> I used the "linint2_points" function interpolating my GCM time series
> data from a grid to arbitrarily specified coordinate pairs(observed
> stations) using bilinear interpolation,and have observed time series
> data of all the stations on the other hand .And I intend to obtain the
> linear regression coefficients between the two data sets at each
> station respectively .That is to say,if there is 754 stations,at aech
> station,it will only uesed the two time series(GCM time series and
> observed time series) of itself,and it reture 754 group data at last
> ,which include "linear regression coefficients" "tval"and"tstd",each
> group and the corresponding station is one to one.I saw there is a
> "regCoef" function can calculate the linear regression coefficient
> between two variables,does it can realize what I want to?
>
> If it can doŁ¬how can I input the station timeseries to ncl,then do
> the regression? I have tried to convert my station data to the GrADS
> station type (.dat) via Fortran coed firstly,then tried to convert the
> .dat file(with the ".ctl") into nc file via the "lats4d" in GrADS,but
> it failed.So after many tried ,I still don't know how to make the
> station data inputing to ncl come true,which have the same format like
> the timeseries at each arbitrarily specified coordinate pair retured
> from the "linint2_points" function, ,do anybody have good ideaŁ¬please
> let me know?
>