.


:




:

































 

 

 

 


( , )




> x<-c(3.5, 3.6, 7.8, 9.6, 5.7, 8.9, 6.3)

> y<-c(1.0, 2.7, 8.9, 6.5, 8.9, 6.5,12.5,10.2, 1.2)

> t.test(x,y,alternative=c("two.sided"),var.equal=TRUE,conf.level=0.95)

 

Two Sample t-test

 

data: x and y

t = -0.0018, df = 14, p-value = 0.9986

alternative hypothesis: true difference in means is not equal to 0

95 percent confidence interval:

-3.760075 3.753726

sample estimates:

mean of x mean of y

6.485714 6.488889

t = -0.0018 ( ), 14.

p-value = 0.9986, .. , 99.86% .

95% (-3.760075, 3.753726). , 5% .

, , :

> t.test(x,y,alternative=c("two.sided"),var.equal=FALSE, conf.level=0.95)

 

Welch Two Sample t-test

 

data: x and y

t = -0.0019, df = 13.242, p-value = 0.9985

alternative hypothesis: true difference in means is not equal to 0

95 percent confidence interval:

-3.545004 3.538655

sample estimates:

mean of x mean of y

6.485714 6.488889

13.242 14, .

( ):

> x<-c(3.5, 3.6, 7.8, 9.6, 5.7, 8.9, 6.3, 8.3, 4.5)

> y<-c(1.0, 2.7, 8.9, 6.5, 8.9, 6.5,12.5,10.2, 1.2)

> t.test(x,y,alternative=c("two.sided"),var.equal=TRUE, paired=TRUE)

 

Paired t-test

 

data: x and y

t = -0.0202, df = 8, p-value = 0.9843

alternative hypothesis: true difference in means is not equal to 0

95 percent confidence interval:

-2.554391 2.509946

sample estimates:

mean of the differences

-0.02222222

:

t = -0.0202 ( ), 8.

p-value = 0.9943, .. , 99.86% .

95% (-2.554391, 2.509946). , 5% .

( ).

() , . , :

,

i - , - i - , - , - .

:

,

,

,

, R bartlett.test()

bartlett.test (x, g...)

x , , ( "lm").
g , x. , x - .

x - , g , bartlett.test(x). , bartlett.test(list (x...)).

( ) [2,.329] - qchisq(p,df).

> x1<-c(3.5, 3.6, 7.8, 9.6, 5.7, 8.9, 6.3)

> x2<-c(1.0, 2.7, 8.9, 6.5, 8.9, 6.5,12.5,10.2, 1.2)

> x3<-c(3.6,7.8,9.6,5.7,8.9)

> x4<-c(2.7,8.9,6.5,8.9)

5.86, 16.75, 6.05 8.57, H0 , 5%.

> bartlett.test(list(x1,x2,x3,x4))

Bartlett test of homogeneity of variances

 

data: list(x1, x2, x3, x4)

Bartlett's K-squared = 2.2368, df = 3, p-value = 0.5247

Bartlett's K-squared = 2.2368 ( ), 3,

p -value = 0.5247, .. H0 52.47%. , 5% .

() , (Cochran) outliers, cochran.test().

cochran.test(object,data)

object ,
data ,

qcochran(p, n, k) , p - , n ( , ), k .

, , 7, 9, 5 4 . H0 , 5%.

> cochran.test(object= c(var(x1),var(x2),var(x3),var(x4)), data=c(7,9,5,4))

Cochran test for outlying variance

 

data: c(var(x1), var(x2), var(x3), var(x4))

C = 0.4499, df = 6.25, k = 4.00, p-value = 0.3083

alternative hypothesis: Group 2 has outlying variance

Cochran C = 0.4499 ( ), ( ) 6.25, 4, p -value 0.3083. ( ). p -value = 0.3083, H0 30.83%. , 5% .

 

( ANalysis Of VAriance ANOVA), F‑ , ( ) ().

. () , () . ( ) :

- , - i - ( i - ), - j - ( j - ), - ( ), - , . , , (, , , , ( ), .

, , :

SS F
()
 

- , - i - , - .

R , .

anova(object)

object lm, glm.

, 20 ( weight, 10 group), , . ( ).

> ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)

> trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)

> group <- gl(2,10,20, labels=c("Ctl","Trt"))

> weight <- c(ctl, trt)

> boxplot(weight ~ group)

> lm.D <- lm(weight ~ group)

> summary(lm.D)

Residuals:

Min 1Q Median 3Q Max

-1.0710 -0.4938 0.0685 0.2462 1.3690

 

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) 4.8465 0.1557 31.124 <2e-16 ***

group1 -0.1855 0.1557 -1.191 0.249

 

Residual standard error: 0.6964 on 18 degrees of freedom

Multiple R-Squared: 0.07308, Adjusted R-squared: 0.02158

F-statistic: 1.419 on 1 and 18 DF, p-value: 0.249

 

> anova(lm.D)

Analysis of Variance Table

 

Response: weight

Df Sum Sq Mean Sq F value Pr(>F)

group 1 0.6882 0.6882 1.4191 0.249

Residuals 18 8.7293 0.4850

summary(), anova() : F- 1.419 1 18 , H0 , group weight, (p -value) 0.249, , 24.9% . , 5% .





:


: 2017-02-28; !; : 660 |


:

:

- - , .
==> ...

1485 - | 1476 -


© 2015-2024 lektsii.org - -

: 0.04 .