# Re: [ferret_users] Why does "regresst" show different result?

HI Iskandar,
When you do it in ferret you are doing it against time unit (days in your case, but your data is of monthly interval) . Where as when you do it in excel you might be doing it against index numbers (which is 1-240, which is essentially equivalent of time unit in months) , this means you are getting rate of change of sla in units of months in second case and in first case you will be calculating it as in units of days.

To cross check you can reconstruct
regression as

reg_line=p*slope+intercep

and check by plotting over original sla

With best regards,
Sudheer

with best regards

Sudheer

**********************************************************************************
Dr. Sudheer Joseph
Scientist,
INCOIS, MoES, Govt. of India.
"OCEAN VALLEY" , Pragathi Nagar (BO), Nizampet SO,  Telangana, India. PIN- 500 090.
Tel:+91-9440832534(Mobile) Tel:+91-40-23886047(O),Fax:+91-40-23892910(O)
E-mail: sjo.India@xxxxxxxxxsjo@xxxxxxxxxxxxx.
-------------------* --------------------
"The ultimate measure of a man is not where he stands in moments of
comfort and convenience, but where he stands at times of challenge and controversy."
Martin Luther King, Jr.
***********************************************************************************

On Tue, Jan 19, 2016 at 9:04 AM, 'Iskhaq Iskandar' via _OAR PMEL Ferret Users wrote:
Dear Ferret users,

I did a simple experiment to see a linear trend of 1-D time series.
The data is attached here.
What I did is something like this:

'use ssh.nc'
'let p = t[gt=sla]'
'let q = sla'
'go regress'
'plot/vs p,what'

The result is good and it shows a reasonable graphic.
However, when I check the value of "slope", I think it is not correct.

'list slope'
VARIABLE : PQVAR / PVAR
FILENAME : ssh.nc
TIME     : 16-DEC-1992 12:00 to 16-DEC-2012 00:00
0.001568

'list intercep'
VARIABLE : QAVE - SLOPE*PAVE
FILENAME : ssh.nc
TIME     : 16-DEC-1992 12:00 to 16-DEC-2012 00:00
-41.19

'list rsquare'
VARIABLE : (PQVAR*PQVAR) / (PVAR*QVAR)
FILENAME : ssh.nc
TIME     : 16-DEC-1992 12:00 to 16-DEC-2012 00:00
0.4646

Then I check this simple calculation using an MS-Excell.
I found that the slope and intercept are different. Only RSQUARE is showing the similar result.
What I got in MS-Excell is:

slope = 0.0477
intercept = 69.284

And I think the results from MS-Excell are correct.

Any idea how to solve it?
Thanks.

Iskhaq

---------------------------------------------------------------- Dr. Iskhaq Iskandar Jurusan Fisika, Fakultas MIPA Universitas Sriwijaya Kampus Inderalaya, Ogan Ilir (OI) Sumatra Selatan, 30662 INDONESIA Phone: +62 (711) 580743 Fax: +62 (711) 580268 E-mail: iskhaq.iskandar@xxxxxxxxx http://iskhaq.wordpress.com/ ----------------------------------------------------------------