Sie sind auf Seite 1von 6

DISTRIBUIÇÃO

Linha 2  Distribuição dos dados (155 observações)  Venda semanal


Transformação BoxCox para o conjunto de dados da linha 2/ Lambda = 0

Shapiro-Wilk normality test

data: w
W = 0.91384, p-value = 5.832e-08
Código no R
DESIGN.VSEMANAL.SZERO <- read.delim("C:/Users/User/Desktop/ARQUIVOS AR
ENA/DESIGN VSEMANAL SZERO.txt")
> View(DESIGN.VSEMANAL.SZERO)
> y <- DESIGN.VSEMANAL.SZERO$QTY
> x <- DESIGN.VSEMANAL.SZERO$WEEK
> hist(y)
> model = lm(y ~ x, data = DESIGN.VSEMANAL.SZERO)
> summary (model)

Call:
lm(formula = y ~ x, data = DESIGN.VSEMANAL.SZERO)

Residuals:
Min 1Q Median 3Q Max
-180.29 -106.67 -69.40 23.75 1104.06

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 182.1198 32.3398 5.631 8.33e-08 ***
x -0.8337 0.3596 -2.318 0.0218 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 200.3 on 153 degrees of freedom


Multiple R-squared: 0.03393, Adjusted R-squared: 0.02762
F-statistic: 5.374 on 1 and 153 DF, p-value: 0.02176

> lag.plot(model$residuals, lags = 1, do.lines = F, labels = F)


> library(lmtest)
> rho = acf(model$residuals)
> qqnorm(y)
> qqline(y)
> library(fpp)
> library(MASS)
> lambda <- BoxCox.lambda(y, method = c("loglik"), lower = -5, upper =
5)
> lambda
[1] 0
> w <- BoxCox(y, lambda)
> as.matrix(w)
[,1]
[1,] 0.0000000
[2,] 3.4965076
[3,] 0.0000000
[4,] 4.9344739
[5,] 2.8332133
[6,] 5.5174529
[7,] 1.6094379
[8,] 5.7071103
[9,] 0.0000000
[10,] 5.0625950
[11,] 1.0986123
[12,] 6.2952660
[13,] 4.9487599
[14,] 0.0000000
[15,] 3.3322045
[16,] 0.6931472
[17,] 5.6347896
[18,] 0.0000000
[19,] 3.5835189
[20,] 5.8021184
[21,] 0.0000000
[22,] 2.9957323
[23,] 2.9957323
[24,] 4.4308168
[25,] 6.2422233
[26,] 0.0000000
[27,] 4.0073332
[28,] 4.2626799
[29,] 5.5093883
[30,] 3.5263605
[31,] 6.3508857
[32,] 4.1431347
[33,] 5.8749307
[34,] 4.3567088
[35,] 3.3672958
[36,] 1.3862944
[37,] 6.1136822
[38,] 4.1108739
[39,] 2.5649494
[40,] 0.0000000
[41,] 5.6835798
[42,] 5.8721178
[43,] 4.4188406
[44,] 3.4011974
[45,] 4.4308168
[46,] 2.8903718
[47,] 7.1284959
[48,] 2.1972246
[49,] 5.5254529
[50,] 5.9687076
[51,] 4.2904594
[52,] 0.0000000
[53,] 4.0253517
[54,] 6.8997231
[55,] 6.4134590
[56,] 5.1059455
[57,] 6.1923625
[58,] 1.7917595
[59,] 6.2085900
[60,] 2.0794415
[61,] 2.9957323
[62,] 5.4764636
[63,] 5.0106353
[64,] 2.4849066
[65,] 0.0000000
[66,] 2.1972246
[67,] 6.3171647
[68,] 4.8598124
[69,] 1.7917595
[70,] 0.6931472
[71,] 5.1761497
[72,] 3.3672958
[73,] 6.9669671
[74,] 1.6094379
[75,] 2.6390573
[76,] 0.0000000
[77,] 5.8944028
[78,] 1.9459101
[79,] 2.9957323
[80,] 1.3862944
[81,] 3.1780538
[82,] 3.5553481
[83,] 2.0794415
[84,] 1.9459101
[85,] 4.6151205
[86,] 2.5649494
[87,] 0.0000000
[88,] 0.0000000
[89,] 3.0445224
[90,] 6.1923625
[91,] 3.7376696
[92,] 4.1896547
[93,] 2.6390573
[94,] 3.0910425
[95,] 3.2188758
[96,] 2.8903718
[97,] 3.9512437
[98,] 4.7184989
[99,] 5.8464388
[100,] 3.4657359
[101,] 3.0445224
[102,] 5.2729996
[103,] 0.0000000
[104,] 3.2188758
[105,] 2.6390573
[106,] 5.4889377
[107,] 4.9416424
[108,] 0.0000000
[109,] 0.0000000
[110,] 0.0000000
[111,] 0.0000000
[112,] 4.3174881
[113,] 4.6249728
[114,] 0.0000000
[115,] 5.1532916
[116,] 0.0000000
[117,] 0.0000000
[118,] 0.0000000
[119,] 1.7917595
[120,] 0.0000000
[121,] 3.0445224
[122,] 5.6767538
[123,] 2.9957323
[124,] 0.0000000
[125,] 4.6539604
[126,] 3.3672958
[127,] 0.0000000
[128,] 4.1588831
[129,] 1.9459101
[130,] 0.0000000
[131,] 2.7725887
[132,] 5.7683210
[133,] 0.0000000
[134,] 0.0000000
[135,] 0.0000000
[136,] 0.0000000
[137,] 3.2188758
[138,] 5.0238805
[139,] 0.0000000
[140,] 0.6931472
[141,] 2.8332133
[142,] 5.3471075
[143,] 5.1704840
[144,] 1.7917595
[145,] 0.0000000
[146,] 2.7080502
[147,] 5.7620514
[148,] 0.0000000
[149,] 0.0000000
[150,] 0.0000000
[151,] 3.0445224
[152,] 6.1675165
[153,] 0.0000000
[154,] 0.0000000
[155,] 0.0000000
> hist(w)
> shapiro.test(w)

Shapiro-Wilk normality test

data: w
W = 0.91384, p-value = 5.832e-08

> qqnorm(w)
> qqline(w)

Das könnte Ihnen auch gefallen