# Regression

From: gibies george <gibies_at_nyahnyahspammersnyahnyah>
Date: Wed Jun 15 2011 - 00:31:38 MDT

Dear NCL users,

I have tried to do a regression analysis to identify the circulation pattern
"data" which favours the index "boxidx" .

regre(lat|:,lon|:,season|:,component|:,idxssn|:,mdl|i,ens|j) =\

(/regCoef(data(lat|:,lon|:,season|:,component|:,mdl|i,ens|j,time|:),\
boxidx(season|:,component|0,mdl|i,ens|j,time|:))/)

*regCoef(data,boxidx) : here "data" is the cause and "boxidx" is its effect*
.

But unfortunately "*boxidx" *have less dimensions* *than *"data"* and this
case is not handled by *regCoef() function*.

I got an error message as follows.

fatal:regCoef: The input array y must have as many or more dimensions than x
fatal:Execute: Error occurred at or near line 2130 in file
/home/gibies/ncl/mylib/lib_gibies_analysis_module.ncl

fatal:Execute: Error occurred at or near line 2460 in file
/home/gibies/ncl/mylib/lib_gibies_analysis_module.ncl

fatal:Execute: Error occurred at or near line 2886 in file
/home/gibies/ncl/mylib/lib_gibies_analysis_module.ncl

fatal:Execute: Error occurred at or near line 22 in file
/home/gibies/ncl/myscripts/skillanal.ncl

By theory *regCoef(data,boxidx)* is not equal to *regCoef(boxidx,**data**)*.
Hence how can I solve this problem?
*____________________________________
Theory

**y = mean(y) + regCoef(x,y){x - mean(x)}
**x = mean(x) + regCoef(y,x){y - mean(y)}
____________________________________*

```--
*Gibies George,   CSIR-RF,*
*Monsoon Seasonal Prediction Group,
Climate and Global Modelling Division,
Indian Institute of Tropical Meteorology,
NCL (P. O.), Pashan,
Pune 411008, India.*