Hi,

To calculate the mean of binned data from an arbitrary length vector 'd',
the following works:

d1 <- runif( 67,0,9 )

while( length(d1) %% 5 != 0 ) {
  d1 <- d1[-length(d1)]
}

dmean1 <- apply( matrix(d1, 5), 2, mean )

Unfortunately, this means dropping (two) data points from the end before I
can execute:

sqrt( mean( dmean1 - dmean2 ) ^ 2 )

Where 'dmean2' is an array of values constructed from running GAM on
'dmean1'.

What is a better way to do this?

Many thanks!
Dave

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to