Вы находитесь на странице: 1из 15

STATA

Excel STATA, , ( 11- ):

Excel
Excel ***.CSV
.

, , -.

Clear

File Import AscII Data created by a Spreadsheet

. insheet y using "C:\Users\\Desktop\Yield.csv"


, ,
, .
(note: variable names in file ignored)
(1 var, 21 obs)
.

..

2014


Data Data Editor

..

2014


Data Create or change data Create new variable (extended)

. egen int time = fill(1 2 3)

..

2014


Statistics Time series Setup and utilites Declare dataset to be timeseries data

. tsset time
time variable: time, 1 to 21
delta: 1 unit

..

2014


Graphics Time-series graph Line plots Create ( Edit)

. twoway (tsline y)

..

2014


Statistics Time series Smoothers/univariate forecasters Movingaverage filter

. tssmooth ma y1 = y, window(2 1 2)
The smoother applied was
(1/5)*[x(t-2) + x(t-1) + 1*x(t) + x(t+1) + x(t+2)]; x(t)= y

..

2014


Statistics Time series Smoothers/univariate forecasters Movingaverage filter

. tssmooth ma y2 = y, weights(-3 12 <17> 12 -3)


The smoother applied was
(1/35)*[-3*x(t-2) + 12*x(t-1) + 17*x(t) + 12*x(t+1) + -3*x(t+2)]; x(t)= y

..

2014

. twoway (tsline y) (tsline y1) (tsline y2)

..

2014


Data Create or change data Create new variable

. generate res = y-y2

..

2014


-
Statistics_____Time-Series______Tests_____Porntmanteau white-noise test

. wntestq y, lags(3)

Portmanteau test for white noise


--------------------------------------Portmanteau (Q) statistic = 27.7507
Prob > chi2(3)

0.0000

:
. wntestq res, lags(3)

Portmanteau test for white noise


--------------------------------------Portmanteau (Q) statistic = 23.9808
Prob > chi2(3)

10

..

0.0000

2014

run.

Statistics - Summaries, tables and tests Nonparametric tests of


hypotheses - Test for random order

. runtest res
N(res <= 0) = 11

N(res > 0) = 10

obs = 21

N(runs) = 21

z = 4.27

Prob>|z| = 0

help STATA. :

N(runs) ( ).
, z .
.

11

..

2014


. runtest y
N(y <= 8.399999618530273) = 11
N(y > 8.399999618530273) = 10
obs = 21
N(runs) = 6
z = -2.46
Prob>|z| = .01
.
.

12

..

2014


-
Statistics - Summaries, tables and tests Distributional plots and tests
Skewness and kurtosis test for normality

. sktest res
Skewness/Kurtosis tests for Normality
------- joint -----Variable Obs Pr(Skewness)

res

13

21

..

0.7562

Pr(Kurtosis)

0.6521

adj chi2(2) Prob>chi2

0.30

0.8609

2014


Graphics Time-series graph Correlogram

14

..

2014

,
run.

15

..

2014

Вам также может понравиться