小的是R新人,有一个问题想问问大家。想对数据做个差分,让它变得平稳,但是为什么画图的时候就出现了问题?还有在做adf检验的时候也一直出问题。。哪位大神帮帮忙。。不胜感激。。。。附程序如下:
> sh<-read.table("D:\\yj.txt",header=F)
> sh
V1
1 500
2 960
3 1000
4 1000
5 5080
6 1557
7 1335
8 1200
9 710
10 160
11 500
12 368
13 150
14 3480
15 810
16 1160
17 3150
18 450
19 1450
20 600
21 1450
22 1650
23 2380
24 80
25 110
26 50
27 260
28 50
29 660
30 1000
31 1109
32 100
33 50
34 4740
35 1500
36 300
37 1990
38 1580
39 1050
40 1100
41 2550
42 1215
43 100
44 6320
45 2125
46 550
47 1000
48 80
49 1500
50 20
51 200
52 580
53 820
54 1900
55 421
56 50
57 300
58 80
59 1300
60 710
61 1060
62 1320
63 222
64 500
65 300
66 1350
67 80
68 100
69 160
70 200
71 160
> logsh<-log(sh)
> adf.test(logsh)
Error in as.vector(x, mode = "double") :
(list) object cannot be coerced to type 'double'
> difflogsh<-diff(logsh)
> difflogsh
data frame with 0 columns and 71 rows
> plot.ts(difflogsh)
Error in plot.window(xlim, ylim, log, ...) : need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf