Displaying 20 results from an estimated 500 matches similar to: "how to predict dynamic model in R"
2011 Feb 22
5
"aggregate" in R
Hi, R users,
I'm wondering how I can aggregate data in R with different functions for
different columns. For example:
x<-rep(1:5,3)
y<-cbind(x,a=1:15,b=21:35)
y<-data.frame(y)
I want to aggregate "a" and "b" in y by "x". With "a", I want to use
function "mean"; with "b", I want to use function "sum". I tried:
2009 Nov 27
2
set condition in R
Hi, R users,
I'm using while() in R to set a condition. My condition is: i<523 or i>535.
How should I write this in R? I try "while (i<523 or i>535)" and it does not
work. Thanks.
Garry
On Tue, Nov 10, 2009 at 11:26 AM, Hongwei Dong <pdxdong@gmail.com> wrote:
> Exactly! Thanks, Duncan.
>
> Let me re-phrase me question like this:
>
> 1) X_i values
2009 Jun 29
2
How to use "subset" in lm function
Hi, I'm using R to do a time series analysis. In the model, I use the lags
of some variables. such the lags of the variables have different length, I
just can't use them directly in the lm function. Intuitively, I feel that
"subset" might be useful, but I do not know how to use it. Anyone can give
me an example syntax? Thanks.
Harry
[[alternative HTML version deleted]]
2010 Oct 16
3
reduce the size of points in plot???
Hi, R users,
Can anyone tell me how I can change the size of points in my plot?
For example:
x <- c(1,3,6,9,12)
y <- c(1.5,2,7,8,15)
plot(x,y,pch=20)
How do I reduce the size of those points?
Thanks.
Gary
[[alternative HTML version deleted]]
2011 Feb 22
4
identify an element in a column
Hi, R users,
I'm wondering if I can identify an element in a column by an element in
another column. For example:
x<-1:10
y<-11:20
z<-cbind(x,y)
z
x y
[1,] 1 11
[2,] 2 12
[3,] 3 13
[4,] 4 14
[5,] 5 15
[6,] 6 16
[7,] 7 17
[8,] 8 18
[9,] 9 19
[10,] 10 20
What I want to do is: when x=5, y=y-1
Anyone can tell me how to do this? Thanks.
Gary
[[alternative
2009 Aug 17
2
memory limit in R
Hi, all, I'm doing a discrete choice model in R and kept getting this error:
Error: cannot allocate vector of size 198.6 Mb.
Does this mean the memory limit in R has been reached?
> memory.size()
[1] 1326.89
> memory.size(TRUE)
[1] 1336
> memory.limit()
[1] 1535
My laptop has a 4G memory with Windows Vista (32 bit). I increased the
memory limit to 2500 M. But still getting the same
2009 Aug 16
1
why summary() does not work here???
Hi, R users,
I'm using the function "vglm" to estimate a multinomial logit model. Every
time I use "summary()" to ask for the coefficients and std error, I got
this:
Length Class Mode
1 vglm S4
Anyone know what's wrong here? Thanks.
Harry
[[alternative HTML version deleted]]
2007 Aug 02
1
Using 'diff' on zoo vs zooreg classes (possible bug?)
Hello,
Can anyone explain the following behaviour? To me it seems a bug, but maybe
it is intentional.
It seems that a diff on a zooreg class that is not _strictly_ regular only
considers those entries that are 'deltat' apart.
In the following, diff on the zooreg class only returns values where the
index was one second apart. The example replicates by dev code, but I've
also tested
2009 Nov 19
2
Problem with zoo and BootPR packages
Hi,
I'm trying to plot the forecasts I generated using the Plot.Fore function of the BootPR package.
But I got an error from zoo:
My data:
Time Series:
Start = 1
End = 18
Frequency = 1
[1] 38731 38628 39117 92809 71984 31226 58613 72360 107956 92066
[11] 95208 99098 95848 120383 110717 105680 98469 101916
Script:
y1<-ts(y1);
2009 Mar 12
1
zooreg and lmrob problem (bug?)
Hi all and thanks for your time in advance,
I can't figure out why summary.lmrob complains when lmrob is used on a
zooreg object. If the zooreg object is converted to vector before
calling lmrob, no problems appear.
Let me clarify this with an example:
>library(robustbase)
>library(zoo)
>dad<-c(801.4625,527.2062,545.2250,608.2313,633.8875,575.9500,797.0500,706.4188,
2010 Jan 20
2
Question about many-to-one merge
I have spent a whole afternoon searching for the solution, but got nothing so
far. It should be a simple problem.
I have two datasets to merge. The first one just contains two ID columns and
it looks like:
FromID ToID
1 2
1 3
2 1
2 3
3 1
3 2
The second one contains a ID column and a variable:
ID X
1 100
2 150
3
2002 Oct 15
3
Share names causing big troubles
I work for a school dist, and I am having a bit of trouble with the "Student
Server" We have about 3000 students all with their own accounts. I had the
samba server setup to share their home directories but their home
directories are the same as their login name. So jamie.mcparland would be an
example of a share name. But in Win 9X it gets truncated to jamie.mcparla
then we get the error
2011 Sep 12
5
Hourly data with zoo
I have date data as a numeric and hourly data in 0 to 2300 hours in a dataframe.
d <- rep(20110101,24)
h <- seq(from = 0, to = 2300, by = 100)
df <- data.frame(LST_DATE = d, LST_TIME = h, data = rnorm(24, 0, 1))
S <- chron(dates. = as.character(df$LST_DATE), times. =
paste(as.character(df$LST_TIME/100), ":0:0", sep = ""),
format =
2010 Apr 18
4
confused with yearmon, xts and maybe zoo
R-listers,
I am using xts with a yearmon index, but am getting some inconsistent
results with the date index when i drop observations (for example by using
na.omit).
The issue is illustrated in the example below. If I start with a monthly
zooreg series starting in 2009, yearmon converts this to "Dec-2008". Not
such a worry for my example, but strange. Having converted to xts, i drop
2011 Sep 22
2
Subsetting a zooreg object using window / subset
Dear R users,
I am currently working in subsetting a zooreg() object using either window or subset. I have a solution but it may be a bit cumbersome when I start working with actual data. Your inputs would be greatly appreciated.
Example: I have a zooreg() object that starts in 1997 and ends in 2001. This object contains daily data for the 4 years
2005 Aug 27
2
zoo, zooreg, & ISOdatetime
I create a zooreg object that runs from Jan-1-2002 0:00 to Jun-1-2005
0:00...
regts.start = ISOdatetime(2002, 1, 1, hour=0, min=0, sec=0, tz="")
regts.end = ISOdatetime(2005, 6, 1, hour=0, min=0, sec=0, tz="")
regts.zoo <- zooreg( NA, regts.start, regts.end, deltat=3600 )
Upon inspection:
> regts.zoo[1:3]
2002-01-01 00:00:00 2002-01-01 01:00:00 2002-01-01 02:00:00
2010 Jul 12
3
How to create sequence in month
Hi all, can anyone please guide me how to create a sequence of months? Here
I have tried following however couldn't get success
> library(zoo)
> seq(as.yearmon("2010-01-01"), as.yearmon("2010-03-01"), by="1 month")
Error in del/by : non-numeric argument to binary operator
What is the correct way to do that?
Thanks for your time.
2011 Apr 06
2
A zoo related question
Dear all, please consider my following workbook:
library(zoo)
lis1 <- vector('list', length = 2)
lis2 <- vector('list', length = 2)
lis1[[1]] <- zooreg(rnorm(20), start = as.Date("2010-01-01"), frequency = 1)
lis1[[2]] <- zooreg(rnorm(20), start = as.yearmon("2010-01-01"), frequency =
12)
lis2[[1]] <- matrix(1:40, 20)
lis2[[2]] <-
2015 Jan 27
2
[LLVMdev] ATS workaround for Clang 3.5
The ATS community is having trouble with clang. They had been using
an older version of clang and upgraded because newer versions give
higher quality warning messages. Unfortunately, with 3.5, moving from
-O1 to -O2 triggers a crash on startup in the clang-generated
executable. I had suggested building with -fsanitize=undefined and
-fsanitize=address to weed out any dependencies undefined
2013 Sep 09
2
(sin asunto)
No he podido crear una matriz con dos columnas una de fechas y la otra
columna con nĂºmeros de casos de una enfermedad x
library(zoo)
zooreg(1:300, start = as.Date("2012-03-01"))
cbind(zooreg(1:300, start = as.Date("2012-03-01")) , c(1:300)) #?como
incluir un vector o una ts?
--
Este mensaje le ha llegado mediante el servicio de correo electronico que