Displaying 2 results from an estimated 2 matches for "xdat2".
Did you mean:
dat2
2010 Aug 01
1
aggregating a daily zoo object to a weekly zoo object
Dear R People:
I'm trying to convert a daily zoo object to a weekly zoo object:
xdate <- seq(as.Date("2002-01-01"),as.Date("2010-07-10"),by="day")
library(zoo)
length(xdate)
xt <- zoo(rnorm(3113),order=xdate)
xdat2 <- seq(index(xt)[1],index(xt)[3113],by="week")
xt.w <- aggregate(xt,by=xdat2,mean)
Error: length(time(x)) == length(by[[1]]) is not TRUE
aggregate(xt,by="week",mean)
Error: length(time(x)) == length(by[[1]]) is not TRUE
I'm not sure what is going wrong. Any help...
2008 Jun 07
2
Using lm with a matrix?
...[,2]
[1,] 5 13
[2,] 8 17
[3,] 11 21
> lrg <- lm(y~x)
Error in eval(expr, envir, enclos) : object "y" not found
> lrg <- lm(ydat~xdat)
> lrg
Call:
lm(formula = ydat ~ xdat)
Coefficients:
[,1] [,2]
(Intercept) 2 9
xdat1 3 4
xdat2 NA NA
--
View this message in context: http://www.nabble.com/Using-lm-with-a-matrix--tp17708207p17708207.html
Sent from the R help mailing list archive at Nabble.com.