Hi,
I have a time series (say "x") of 13 years showing an evident increase. I want
to exclude two observations (the fourth and 10th), so I do:
> trend.test(x[-c(4,10)])
where:
> x[-c(4,10)]
[1] 7 37 79 72 197 385 636 705 700 1500 1900
and I get:
Spearman's rank correlation rho
data: x[-c(4, 10)] and time(x[-c(4, 10)])
S = 4, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.9818182
Very strong positive correlation! the "x" is increasing
Now, I would like to resample this time series because I have others time
series where the trend is more "uncertain" and the sample size is still small.
I read "Resampling Methods in R: The boot Package (ISSN 1609-3631)" and I
believe that a way of doing it is by a block bootstrap that allows to deal with
the autocorrelation (I know that some of my time series show autocorrelation,
lag=1).
I used "trend.test" function (library=pastecs) and I did:
>trend.x=trend.test(x[-c(4,10)],R=999)
>trend.x
>trend.x$p.value
>plot(trend.x)
And I get:
> trend.x=trend.test(x[-c(4,10)],R=999)
> trend.x
BLOCK BOOTSTRAP FOR TIME SERIES
Fixed Block Length of 1
Call:
tsboot(tseries = x, statistic = test.trend, R = R, l = 1, sim = "fixed")
Bootstrap Statistics :
original bias std. error
t1* 0.9818182 -0.9844001 0.3272114
> trend.x$p.value
[1] 0
I suppose that the problem arises from the length of the block (1) and in this
way I get a rho=0, (nevertheless I don't understand how it is significant).
I would like to change the block length but I am not able to (I tried in
several different ways but unsuccessfully).
So, two questions:
1) How can I change the block length?
2) In terms of block length and type of simulation (sim="fixed" or "geom"),
what is the best way of doing it?
Thanks in advance for any suggestion,
Best wishes
Simone
¿Quieres conocerte mejor? ¡Conoce lo que Windows Live tiene especialmente para
ti!
_________________________________________________________________
[[elided Hotmail spam]]
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.