[R-sig-Geo] gridded time series analysis

Robert J. Hijmans r.hijmans at gmail.com
Mon Nov 29 19:20:57 CET 2010


You can return anything you like, as long as it is numeric (or a
vector of numerics). R^2 should come out like this:

 fun=function(x) { if (is.na(x[1])){ NA } else { m <-
lm(x[1]~x[2])$coefficients[2]; summary(m)$r.squared  }}


slope and R^2

 fun=function(x) { if (is.na(x[1])){ NA } else { m <-
lm(x[1]~x[2])$coefficients[2]; c(m$coefficients[2],
summary(m)$r.squared  }}

Robert

On Mon, Nov 29, 2010 at 1:58 AM, Martin <martin_brandt at gmx.net> wrote:
>
> another thing which might be interesting:
>
> I know I can call the intercept with "coefficients[1]" and the slope with
> "coefficients[2]". But is it also possible to get a gridded result with the
> other lm regression results (normaly available via "summary()") , like R²,
> p-value, or residuals?
>
> Martin
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/gridded-time-series-analysis-tp5775651p5783798.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list