0
Good night, you guys.
I am trying to apply the Pettitt test to a series of data. I am using the package trend
in the R
. Only that the result found is not what I’m looking for, which is what follows below:
> pettitt.test(URB_out_ts)
Pettitt's test for single change-point detection
data: URB_out_ts
K = 132, p-value = 0.3587
alternative hypothesis: true change point is present in the series
sample estimates:
probable change point at tau
34
I would like to get a result similar to the figure below. Only I looked for the function in the package TSA
and does not exist. Someone knows how to get this result?
The line
pettitt(larain)
makes a mistake:Error in pettitt(larain) : could not find function "pettitt"
. You can show us the exact code you used to get the question output?– Rui Barradas
What I used was the "pettitt.test". This low I found on the internet, but I could not run or found any package with the command "pettitt".
– Leonardo Barbieri
What you found on the Internet was on Cross Validated. Includes two similar functions, the one that gives this image and the one below. Just copy to a
R
and execute.– Rui Barradas