[GRASS-user] Calculate p value for regression slope in r.series
王德辉
dehuiw at gig.ac.cn
Fri Nov 9 04:02:11 PST 2012
Thank you Paulo! I think your way is feasible. For r.series, t could be caluclate via R2 using r.mapcalc. I am also a newcomer to time series analysis. Hope r.series may add t,f, p function soon.
Best regard,
Dehui
-----原始邮件-----
发件人: "Paulo van Breugel" <p.vanbreugel at gmail.com>
发送时间: 2012年11月9日 星期五
收件人: "王德辉" <dehuiw at gig.ac.cn>
抄送: "GRASS users email list" <grass-user at lists.osgeo.org>
主题: Re: Re: [GRASS-user] Calculate p value for regression slope in r.series
Hi Dehui,
What about my previous suggestion to use dummy variable that indicates time periods (fixed values 0, 1,2,3...N) for N time periods? I am new to time series analysis, so please let me know if the below makes sense.
So you could use your data (Y) as one time series, and the dummy time variables as the second time series (T): Y = bT + c. Resulting slope, offset and R2 between r.series and r.regression.series are close to identical. Differences are very small (a factor 10¹⁰ smaller then the actual slope or offset value) soI assume this is due to some differences in rounding (@MarkusN, do you have an idea?)
Concrete, if you have a time series of let's say annual rainfall over 10 years. You create 10 layers using r.mapcalc, with all cells of the first layer = 0, all cells in the second layer = 1... all cells in the 10th layer = 9. Now you have two time series you can use in r.regression.series.
There is the possible problem of auto-correlation, so the t and f values calculated with r.regression.series should be considered with care. As said, I am new to time series analysis, so will need to study more how to deal with this. Not sure that is going to be easy using GRASS.
Cheers,
Paulo
On Thu, Nov 8, 2012 at 2:21 PM, 王德辉 <dehuiw at gig.ac.cn> wrote:
r.regression.series is a module to calculate linear regression parameters between two time series. I only want to calculate parameters in one time series, how to use this model in one time serie condition?
thanks!
dehui
-----原始邮件-----
发件人: "Paulo van Breugel" <p.vanbreugel at gmail.com>
发送时间: 2012年11月8日 星期四
收件人: "Moritz Lennert" <mlennert at club.worldonline.be>
抄送: "GRASS users email list" <grass-user at lists.osgeo.org>
主题: Re: [GRASS-user] Calculate p value for regression slope in r.series
Good suggestion, and coincidentally I was just looking at it. Am I correct to assume that to mimic the calculation of slope etc in r.series, I would need to create a second time series of 'dummy' maps with values 0 for first time period, 1 for second time period, etc.? I did this in R and it gave the same slope and offset as r.series.
Just wondering, if it is implemented in r.regression.series, would it be very difficult to port to r.series? Or do the two things function different internally?
Cheers,
Paulo
On Thu, Nov 8, 2012 at 10:55 AM, Moritz Lennert <mlennert at club.worldonline.be> wrote:
On 06/11/12 09:55, Paulo van Breugel wrote:
Hi,
I am using r.series to calculate linear regression slope, offset and
coefficient of determination. But any idea how I can get the standard
deviation t-value and p-value of the slope?
Try MarkusN's r.regression.series in the addons for grass7. It allows the calculation of t and f values. IIRC, p-value can be calculated from t-value.
Moritz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20121109/0b0e26f9/attachment-0001.html>
More information about the grass-user
mailing list