Anda di halaman 1dari 4

Aulia Kahfi

14305144018
Matematika E 2014
> akahfi2<-read.table("E:\\aregresi\\akahfi2.txt",header=T)
> akahfi2
x y
1 7 5
2 10 6
3 11 10
4 8 15
5 20 17
6 9 12
7 15 13
8 5 18
> cor.test(~x+y,data=akahfi2)
Pearson's product-moment correlation
data: x and y
t = 0.5952, df = 6, p-value = 0.5735
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5620748 0.8065872
sample estimates:
cor
0.2361205

> lm(y~x,data=akahfi2)
Call:
lm(formula = y ~ x, data = akahfi2)
Coefficients:
(Intercept)
x
9.5058
0.2347
> akahfi2.lm=lm(y~x,data=akahfi2)
> summary(akahfi2.lm)

Call:
lm(formula = y ~ x, data = akahfi2)

Residuals:
Min

1Q Median

3Q

Max

-6.1490 -3.0293 0.1772 3.0035 7.3205

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.5058
x

0.2347

4.5506 2.089 0.0817 .


0.3944 0.595 0.5735

--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1

Residual standard error: 5.018 on 6 degrees of freedom


Multiple R-squared: 0.05575, Adjusted R-squared: -0.1016
F-statistic: 0.3543 on 1 and 6 DF, p-value: 0.5735
Uji Signifikansi Model Regresi :
Hipotesis:

H0 : model regresi tidak layak


H1 : model regresi layak

Dari nilai p-value 0.5735 yang lebih besar dari nilai alpha
maka H0 diterima. Artinya model regresi tidak layak.
Uji signifikansi parameter
D

alam menyimpulkan signifikansi parameter dapat secara cepat dilihat


masing-masing P-value untuk intercept (konstanta) dan Y (untuk
dari
1 ).karena nilai
p-value untuk konstanta adalah 0,889 > 0,05 maka konstanta tidak
signifikan
sedangkan 1 signifikan karena nilai p-value > 0,05.

> residuals(akahfi2.lm)
1
2
3
4
5
6
7
8
-6.14903475 -5.85328185 -2.08803089 3.61621622 2.79922780 0.38146718
-0.02702703 7.32046332
> residu1=residuals(akahfi2.lm)
> shapiro.test(residu1)

Shapiro-Wilk normality test


data: residu1
W = 0.95695, p-value = 0.7806
> summary(lm(abs(akahfi2.lm$res)~akahfi2.lm$fit))
Call:
lm(formula = abs(akahfi2.lm$res) ~ akahfi2.lm$fit)
Residuals:
Min
1Q Median
3Q Max
-3.6508 -1.5310 0.3862 2.0704 2.1711
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 19.3487 9.8695 1.960 0.0976 .
akahfi2.lm$fit -1.3183 0.8193 -1.609 0.1587
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Residual standard error: 2.447 on 6 degrees of freedom
Multiple R-squared: 0.3014, Adjusted R-squared: 0.185
F-statistic: 2.589 on 1 and 6 DF, p-value: 0.1587
> ks.test(residu1,pnorm)
One-sample Kolmogorov-Smirnov test
data: residu1
D = 0.37244, p-value = 0.1671
alternative hypothesis: two-sided

Anda mungkin juga menyukai