In addition, we could create a function to.df which converts a zoo
object to a data frame assuming that any column that only contains
1:nlevels is a factor with the indicated level names. Use to.df just
before plotting:
library(zoo)
set.seed(1)
f <- zoo(factor(sample(3, 10, replace = TRUE)))
x <-
Thank you.
I will try to get the book, althoug I am not sure if I with my tiny
knowledge of mathematics will be able to digest it.
Meanwhile I tried to make 7 min average and then to reanalyze by spectrum,
but the output was not very convincing.
Regards
Petr Pikal
[EMAIL PROTECTED]
Rolf Tur
On Thu, 16 Aug 2007, Felix Andrews wrote:
list(...),
I am working with environmental time series (eg rainfall, stream flow)
that have attached quality codes for each data point. The quality
codes have just a few factor levels, like "good", "suspect", "poor",
"imputed". I use the quality codes i
On 16/08/2007, at 12:26 AM, Petr PIKAL wrote:
> Dear all
>
> Please help me with analysis of some periodic data.
>
> I have an output from measurement each minute and this output is
> modulated
> by rotation of the equipment (approx 6.5 min/revolution). I can easily
> spot this frequency from
>
On Mon, 16 Jul 2007, livia wrote:
>
> Hi all, I have got some time series data. Data[[1]] is the data in the format
> "1975-12-05 1975-12-12 1975-12-19...", data[[2]] is the time series data. I
> would like to generate the time series format as
> 1975-12-05 1.5
> 1975-12-12 2.3etc.
>
> I am thin
Check out the zoo package:
Lines <- "1975-12-05 1.5
1975-12-12 2.3
"
library(zoo)
# replace next line with z <- read.zoo("myfile.dat")
z <- read.zoo(textConnection(Lines))
plot(z)
z
vignette("zoo") # gives more info
On 7/16/07, livia <[EMAIL PROTECTED]> wrote:
>
> Hi all, I have got some time
D)'; r-help@stat.math.ethz.ch
Subject: Re: [R] Time series\optimization question not R question
Your approach obviously won't give you the same result as when the
likelihood is optimized jointly with A and \beta. However, you can maximize
the likelihood over \beta for different values of A, w
Your approach obviously won't give you the same result as when the
likelihood is optimized jointly with A and \beta. However, you can maximize
the likelihood over \beta for different values of A, which would give you a
"profiled" likelihood. Then you pick the \beta and A corresponding to
maximum
Can you give us a little more information? Are you
expecting N times to be record and want to know if you
only have N-x times or are you expecting N entries but
want to know if some are NA? Etc, etc...
Also are you actually recording the times or is the
sampling setup just taking a sample every
Jessica,
> I am working with a data file which is the record of precipitation
> measurement normaly done every 10 minutes. I would like to check if there
> are missing times in my data file.
>
> Is there a function existing able to check for that in R ?
I'd use max(diff(time))==min(diff(time)).
On Tue, 24 Apr 2007, Tomas Mikoviny wrote:
> Hi everybody,
>
> I work with data with following pattern
>
> > comm
>
> "Date" "Value"
> 1 4/10/2007 361.2
> 2 4/11/2007 370.1
> 3 4/12/2007 357.2
> 4 4/13/2007 362.3
> 5 4/16/2007 363.5
Hello John,
as a starting point you might also want to have a look at:
@book{BOOK,
author={Robert S Pindyck and Daniel L Rubinfeld},
title={Econometric Models and Economic Forecasts},
year={1997},
publisher={McGraw-Hill/Irwin},
isbn={0079132928}
}
The monographies of Hamilton and Lütkepohl might
John --
Well, as a start, have a look at "Modern Applied Statistics with S," by
Venables and Ripley, both of which names you will recognize if you read
this list often. There is a 30-page chapter on time series (with
suggestions for other readings), obviously geared to S and R, that is a
good jum
Here's an example illustrating a way to get a second y axis that has
a different range:
x <- 1:10
y1 <- 2*x
y2 <- 100-3*x+rnorm(10)
par(mar=c(5.1,4.1,4.1,4.1))
plot(x,y1)
par(new=TRUE)
plot(x,y2,xaxt='n',yaxt='n',xlab='',ylab='',pch=3)
axis(4)
mtext('y2',side=4,line=2.5)
-Don
At 2:18 PM +0530
ot;r-help@stat.math.ethz.ch"
Subject:Re: [R] Time series plot
> Dear Gabor,
>
> Thank you very much for your letter. Actually I got partial solution
> from your suggestion. Still I am fighting with defining a secondary
> axis. More pecisely, suppose I have followin
Check out #2 in:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/85801.html
and RSiteSearch("axis(4") to find additional examples.
On 1/4/07, Arun Kumar Saha <[EMAIL PROTECTED]> wrote:
> Dear Gabor,
>
> Thank you very much for your letter. Actually I got partial solution from
> your suggestion.
Dear Gabor,
Thank you very much for your letter. Actually I got partial solution from
your suggestion. Still I am fighting with defining a secondary axis. More
pecisely, suppose I have following two dataset:
x = c(1:10)
y = x*10
To plot x I can simply write plot(x, type='l'), here the"y-axis" ta
You can use read.zoo in the zoo package to read in the data
and then see:
https://www.stat.math.ethz.ch/pipermail/r-help/2006-December/122742.html
See ?axis for creating additional axes with classic graphics and
library(lattice)
?panel.axis
in lattice graphics. Search the archives for examples
First, I'd write down a model for how your stochastic process
relates to independent, normal observations with mean 0 and standard
deviation 1. You want a lognormal series, so I'd start by generating a
normal series and the compute 'exp' of that. If you'd like more help
from this listse
On 28 September 2006 at 22:00, David Kaplan wrote:
| Greetings,
|
| Are there R packages that perform time-series analyses - particularly
| estimation of ARIMA models along with unit-root tests? I know that
| FinMetrics in the S-Plus program will do it, but I'm looking for R
| packages, as we
Gabor Grothendieck wrote:
> When the axis labelling does not work well you will have to do it yourself
> like this. The plot statement is instructed not to plot the axis and then
> we extract into tt all the dates which are day of the month 1. Then
> we manually draw the axis using those.
>
> li
When the axis labelling does not work well you will have to do it yourself
like this. The plot statement is instructed not to plot the axis and then
we extract into tt all the dates which are day of the month 1. Then
we manually draw the axis using those.
library(zoo)
set.seed(1)
z <- zoo(runif(
Spencer Graves wrote:
> I know of no software for time series clustering in R. Google
> produced some interesting hits for "time series clustering". If you
> find an algorithm you like, the author might have software.
> Alternatively, the algorithm might be a modification of something
I know of no software for time series clustering in R. Google
produced some interesting hits for "time series clustering". If you
find an algorithm you like, the author might have software.
Alternatively, the algorithm might be a modification of something
already available in R. If
Try this (where you can replace textConnection(L) with name
of file containing data):
L <- "01/02/1990 0.531 0.479
01/03/1990 0.510 0.522
01/06/1990 0.602 0.604"
library(zoo)
z <- read.zoo(textConnection(L), format = "%m/%d/%Y")
plot(z, plot.type = "single")
This will give more info on zoo:
lib
You might want to look at the dyn package. It allows
time series in model formulae, e.g. this aligns UKgas
and diff(UKgas) properly:
dyn$lm(UKgas ~ diff(UKgas))
dyn$ transforms the above to
dyn(lm(dyn(UKgas ~ diff(UKgas
and the inner dyn adds class "dyn" to the formula's class vector
The problem here is that you called model.frame() with (I presume, the
'factory-fresh' default) na.action=na.omit, and model.frame is documented
to remove tsp attributes in that case.
Use model.frame(..., na.action = NULL), e.g.
model.frame(~UKgas, na.action=NULL)[[1]]
is a time series
I don't have a direct answer to your question, but in case you are
interested in a general introduction to time series capabilties in R, I
will suggest the following:
1. Ch. 14 in Venables and Ripley (2002) Modern Applied Statistics
with S, 4th ed. (Springer)
2.
If this were my problem, I might start by considering each
stimulus-response pair as a one observation, and I'd break the MEG into
separate time series, each starting roughly 1 second before the stimulus
and ending roughly 1 second after. If you've averaged many of these,
I'm guessin
Have you read Pinheiro and Bates (2000) Mixed-Effects Models in S and
S-Plus (Springer)? The latter part about nonlinear modeling with mixed
effects sounds like it could help you a lot.
1. Consistent with that, I might start by averaging over all 15
people, then making plo
If you have not received an adequate reply to this and would still
like help, please submit a more specific question, preferably with a
small self-contained example that someone can copy from your email,
paste into R, and try some alternatives in a minute or two. R has many
capabilil
Quoting Spencer Graves <[EMAIL PROTECTED]>:
> 1. Have you read the appropriate chapter in Venables and Ripley
> (2002) Modern Applied Statists with S (Springer)? If no, I suggest you
> start there.
>
> 2. Have you worked through the vignettes associated with the "zoo"
> package?
1. Have you read the appropriate chapter in Venables and Ripley
(2002) Modern Applied Statists with S (Springer)? If no, I suggest you
start there.
2. Have you worked through the vignettes associated with the "zoo"
package? If no, you might find that quite useful. [Are
Wensui Liu wrote:
> TS is a huge topic. The book recomended by statisitcian might be
> different from the one recommended by econometrician. Finance guy
> might recommend another. Could you please be more specific?
My software (http://moodss.sourceforge.net) collects, archives in a
SQL database
TS is a huge topic. The book recomended by statisitcian might be different
from the one recommended by econometrician. Finance guy might recommend
another.
Could you please be more specific?
On 9/8/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> There has been a few questions on the subj
On 9/4/05, Anette Nørgaard <[EMAIL PROTECTED]> wrote:
> About time series graphs, I need help to move on:
>
> A time series of data directly from a data logger comes in the dat
> format created below:
>
> year<-c(rep(2005,10))
> doy<-c(rep(173,5),rep(174,5))
> time<-c(15,30,45,100,115,15,30,45,10
On Mon, 2005-08-22 at 13:04 +0100, Prof Brian Ripley wrote:
> On Mon, 22 Aug 2005, javier garcia - CEBAS wrote:
>
> > My native language is spanish and I would need to do two changes in the
> > default xlabels in timeseries plots:
>
> What sort of plots are you talking about here? (Not tsplot or
On Mon, 22 Aug 2005, javier garcia - CEBAS wrote:
> My native language is spanish and I would need to do two changes in the
> default xlabels in timeseries plots:
What sort of plots are you talking about here? (Not tsplot or plot.ts,
for example.) I think you are perhaps talking about plots of
On Fri, 22 Jul 2005 14:46:31 -0400 Sean Davis wrote:
> Preface: this is a statistical question more than an R question.
>
> I have a vector of numbers (assume a regular time series). Within
> this time series, I have a set of regions of interest (all of
> different lengths) that I want to compa
Paul,
Thank you so much for your thoughtful reply. I agree - there are many
possible descriptions for my data, and I realize that I don't want to
get bogged down with figuring out the 'best' model if something simple
will work well. For me, I think the difficulty is going to be handling
the cumula
We are leveraging too far on speculation, at least from what I can
see. PLEASE do read the posting guide!
"http://www.R-project.org/posting-guide.html";. In particular, try the
simplest example you can find that illustrates your question, and
explain your concerns to us in terms of
Dear Brett:
There are books for this topic that are more narrowly tailored to your
question. Lindsey's Models for Repeated Measurements and Diggle, et al's
Analysis of Longitudinal Data. Lindsey offers an R package on his web
site. If you dig around, you will find many modeling papers on this,
Thanks for the suggestion. Is such a model appropriate for count data?
The library you reference seems to just be form standard regressions
(ie those with continuous dependent variables).
Thanks,
Brett
On 7/16/05, Spencer Graves <[EMAIL PROTECTED]> wrote:
> Have you considered "lme" in
Have you considered "lme" in library(nlme)? If you want to go this
route, I recommend Pinheiro and Bates (2000) Mixed-Effect Models in S
and S-Plus (Springer).
spencer graves
Brett Gordon wrote:
> Hello,
>
> I'm trying to model the entry of certain firms into a larger num
On Fri, 8 Jul 2005, yyan liu wrote:
> Hi:
> I have two time series y(t) and x(t). I want to
> regress Y on X. Because Y is a time series and may
> have autocorrelation such as AR(p), so it is not
> efficient to use OLS directly. The model I am trying
> to fit is like
> Y(t)=beta0+beta1*X(t)+rho*
On 7/8/05, yyan liu <[EMAIL PROTECTED]> wrote:
> Hi:
> I have two time series y(t) and x(t). I want to
> regress Y on X. Because Y is a time series and may
> have autocorrelation such as AR(p), so it is not
> efficient to use OLS directly. The model I am trying
> to fit is like
> Y(t)=beta0+beta1*
Thanks, Gabor. Reading your suggestion (and a previous one as well) I
realized I surely expressed myself quite badly when asking the
question.
Luckily one person privately suggested the following solution, which
is exactly what I was looking for:
x[time(x)==2] <- 0
This works wonderfully. Howeve
On 4/26/05, Fernando Saldanha <[EMAIL PROTECTED]> wrote:
>
> I tried to assign values to specific elements of a time series and got
> in trouble. The code below should be almost self-explanatory. I wanted
> to assign 0 to the first element of x, but instead I assigned zero to
> the second element
Fernando Saldanha schrieb:
I tried to assign values to specific elements of a time series and got
in trouble. The code below should be almost self-explanatory. I wanted
to assign 0 to the first element of x, but instead I assigned zero to
the second element of x, which is not what I wanted. Is the
Thanks, Achim,
I managed to do what I wanted, thanks to your suggestion, except for
one thing. When I called ts.intersect I could only provide numerical
arguments (more precisely, objects that can be coerced into time
series, I guess). That means I was not able to pass the original
row.names that
On Tue, 12 Apr 2005 18:47:21 -0400 Fernando Saldanha wrote:
> Can one also predetermine a set and then estimate all the models one
> wants to compare using the zoo package?
Sure, you can merge() several series first and then pass this as the
data argument to lm(). See the vignette of the zoo pack
Can one also predetermine a set and then estimate all the models one
wants to compare using the zoo package? Or can that be done only with
the tseries package?
Thanks.
FS
On 4/12/05, Achim Zeileis <[EMAIL PROTECTED]> wrote:
> Fernando:
>
> > This maybe a basic question, but I have spent severa
Fernando:
> This maybe a basic question, but I have spent several hours
> researching and I could not get an answer, so please bear with me. The
> problem is with time series in the package tseries.
BTW: the `tseries' package is not involved here.
> As the example
> below shows, the time series
On Wed, 16 Mar 2005 [EMAIL PROTECTED] wrote:
I'm using a dataset with unequally spaced time series
and I'd want to know if there is in R some function in
order to calculate the autocorrelation function, because
acf() in stats package cannot calculate it, because I
have many missing data, and data a
see packages zoo and its on cran.
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 16, 2005 7:17 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Time Series
>
>
> Hello,
>
> I'm using a dataset with unequally spaced time series
> and I'd
Hello, Kum-Hoe:
Have you considered the "strucchange" package? Inspired and
informed by Gabor's comments, it looks to me at the moment like this
package help you fit intervention / regression fits with time series /
ARMAX models with minimum hassle.
hope this helps.
spencer
Spencer Graves pdf.com> writes:
:
: Thanks. Which package(s) do you prefer for which purposes?
'ts' can be used for regularly spaced time series and supports
monthly and quarterly dates. The other ones listed below supports
irregular time series.
zoo's design goals are consistency w
Hi, Gabor:
Thanks. Which package(s) do you prefer for which purposes?
Best Wishes,
Spencer Graves
Gabor Grothendieck wrote:
Spencer Graves pdf.com> writes:
: In particular, what's the preferred way to keep track of dates with
: time series? I tried assigning a "Date" objec
Spencer Graves pdf.com> writes:
: In particular, what's the preferred way to keep track of dates with
: time series? I tried assigning a "Date" object somehow to a "ts"
: object, so far without success. Two of my attempts are as follows:
:
: > tst2 <- ts(1:11, frequency=365,
: +
Rene Pineda wrote:
I need information about space state models in structural model and kalman
filtering. I have a univariate time serie and i nedd aplicate space state model
Please use an informative subject line! See
?arima
and the references therein.
See also the R Newsletter, volume 2/2, 200
Costas Vorlow wrote:
Hello,
I am trying to rotate by 90 degrees a time series plot. So I need the
time axis to be the vertical one. Is there an easy way?
No, you have to do it manually, AFAIK.
Uwe Ligges
I couldn't guess anything from the help pages.
Apologies for a silly question.
Regards,
Cost
window() is the normal way to do this.
On Tue, 15 Jun 2004, Laura Holt wrote:
> Hi R People:
>
> I have a monthly time series x.ts which runs from 1/1995 through 12/2003.
>
> >x.ts <- ts(x,start=1995,freq=12)
> >str(x.ts)
> Time-Series [1:108] from 1995 to 2004: -1.638 -0.236 0.830 -0.548 0.3
?window
Date: Tue, 15 Jun 2004 18:43:04 -0500
From: Laura Holt <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: [R] time series object
Hi R People:
I have a monthly time series x.ts which runs from 1/1995 through 12/2003.
>x.ts <- ts(x,start=1995,freq=12)
>str(x.ts)
Time-Se
Hi Eduardo,
Probably a good idea is to do a multivariate analysis through spectral
analysis. With function spectrum you can look for coherence and phase
between several time series. In your case with different lengths, you can
use the option: na.action=na.omit
>rainfall5<-spectrum(ts.union(s1,s2,
[EMAIL PROTECTED] wrote:
R-listers:
I may be asking too much from R, but is there a way to use time indexing
on a time series object. For instance:
tsobject <- ts(1:12, start =1999, freq = 4)
tsobject
Qtr1 Qtr2 Qtr3 Qtr4
19991234
20005678
20019 10
> I was wondering if anyone had some sample time series dgp
> code. I am
> particularly interested in examples of autoregressive processes and
> error correction model DGPs. I have attached a more specific example
> of what I mean. I have tried myself but would hoping someone
> had some
>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Andy Bunn
>Sent: Wednesday, March 19, 2003 12:15 PM
>To: [EMAIL PROTECTED]
>Subject: [R] Time Series-like barplot?
>
>
>I have data structured like the following:
>
>> foo.mat <- matrix(NA, ncol = 5, nrow
The following produces thick lines like you requested:
plot(c(1, 10), c(1, 5), type="n")
for(j in 1:5)
lines(range(which(!is.na(foo.mat[,j]))), rep(j, 2), lwd=10)
If you want open bars, then draw boxes inside the loop.
Is this satisfactory?
Spencer Graves
Andy Bunn wrote
On Fri, Feb 14, 2003 at 11:21:33AM +, [EMAIL PROTECTED] wrote:
> Yes, there is an easy way. Create the regular time series you want by
> something like
>
> x <- ts(0, start=c(2000,52), end=c(2003,9), frequency=52)
>
> and fill in the time points you have data for by
>
> xYear <- trunc(time
Yes, there is an easy way. Create the regular time series you want by
something like
x <- ts(0, start=c(2000,52), end=c(2003,9), frequency=52)
and fill in the time points you have data for by
xYear <- trunc(times(x)); xWeek <- cycle(x)
attach(mydata)
x[(xYear==year) & (xWeek==Week)] <- Count
d
70 matches
Mail list logo