You are on page 1of 13

M ..

:09104224

1
I.

20
... P(X=x) = px-1(1-p)x x = 1, 2, 3, 0 < p < 1.
:
:
,
Bernoulli, .
, .
.
... :
:
( )

),

, :
( )

( )


p, 0
. 2
.
( )

p :

M ..:09104224
... p :

II.

... R
:

x<-c(3,1,1,4,1,1,7,1,1,1,2,1,1,1,2,2,2,1,1,4)
p<-seq(0.001,0.999,length=10000)
geom_loglikelihood<-function(data,p){
results<-rep(NA,10000)
for(i in 1:10000){
results[i]<-sum(dgeom(data.p[i].log=T))

H R


(. x

) 10000

p.

return(results)
}
results<-geom_loglikelihood(y,p)

plot(p,results,xlab="p",ylab="loglikelihood",type="l")
actual_mle<-(1+mean(y))^(-1)
actual_mle
p[order(results)[10000]]



.

.

R ...
.
0.5 ...

M ..:09104224

2
I.



( QQ-plot).

,
.

R :

M ..:09104224
x<c(0.52,0.82,1.25,1.91,2.61,3.82,1.40,1.97,2.85,3.92,0.97,1.52,2.01,2.95,0.99,1.72,2.10,3.12,1.
00,1.75,3.20,3.30,3.13,3.11)
hist(x)
qqnorm(x)
qqline(x)

QQ-plot !


qqplot


.

mg


.

II.


( n=24<50) ,
p- R one sample
t-test .
, Wilcoxon-test.
R :

M ..:09104224
wilcox.test(x,mu=2,alternative="greater")
= 5%
default . alternative="greater"
(<).
:
Wilcoxon signed rank test

data: x
V = 176, p-value = 0.2366
alternative hypothesis: true location is greater than 2

p- (p-value)


, .
p-
( 5%) .
p-value=0,2366>0.05
=2.
,
2 mg.

3
I.

,
pie chart,

.
:
x<-c(rep("",5),rep("",15))
prop.table(table(x))
AA<-table(x)
pie(AA, main="T ")


25% 75%

M ..:09104224

II.

(

... R
prop.test(5,20,p=0.4,conf.level=0.98,alternative="less")

= 2%.
1-sample proportions test with continuity correction

data: 5 out of 20, null probability 0.4


X-squared = 1.3021, df = 1, p-value = 0.1269
alternative hypothesis: true p is less than 0.4
98 percent confidence interval:
0.0000000 0.5046064
sample estimates:

p
0.25

M ..:09104224
p- 0.1269 0.02
.
40%. (
0.4 ..,

4
I.


.
.
2
R:
a<-c(1.2,0.3,0.8,0.5,0.4,1.3,1.4)

b<-c(1.6,1.5,1.1,1.0,1.8,1.7,0.9,0.7,0.6)
Min.
summary(a)

1st Qu. Median Mean 3rd Qu. Max.

0.3000 0.4500 0.8000 0.8429 1.2500 1.4000

summary(b)
Min.
boxplot(a,b,names=c(" "," ")

1st Qu. Media Mean 3rd Qu. Max.

0.600 0.900 1.100 1.211 1.600 1.800

0.8429tn/cm2.
1.4 tn/cm2 0.3 tn/cm2 .
25% 0.45
tn/cm2, 50% 0.8 tn/cm2 25% 1.25 tn/cm2.

1.211 tn/cm2.
1.8 tn/cm2 0.6 tn/cm2.
25% 0.9 tn/cm2,
50% 1.1 tn/cm2 25% 1.6 tn/cm2.

M ..:09104224

II.


;
;

M ..:09104224

R:

par(mfrow=c(2,2))
hist(a,main="I ",xlab=" ",ylab="")
qqnorm(a)
qqline(a)
hist(b,main="I ",xlab=" ",ylab="")
qqnorm(b)
qqline(b)

H (
qqplots)
Wilcoxon rank sum test, .
T wilcox.test (a,b) :
9

M ..:09104224

Wilcoxon rank sum test

data: a and b
W = 17, p-value = 0.1416
alternative hypothesis: true location shift is not equal to 0

p- = 0.1416 >0.1 ,
.

5
I.

R
:

x<-c(rep(0,70),rep(1,180))


x (
) y(
) 1 0
( , ).

y<-c(rep(0,60),rep(1,90))

par(mfrow=c(1,2))
barplot(prop.table(table(x)))
title(main="",sub=" A

")

barplot(prop.table(table(y)))
title(main=" ",sub=" A

")

10

M ..:09104224

mean(x)
[1] 0.28
mean(y)
[1] 0.4
28%
40% .

II.
E prop-test R
.

11

M ..:09104224
:

.
T R
x<-c(70,60)
n<-c(250,150)
prop.test(x,n,correct=FALSE,conf.level=0.99,alternative="less")

2-sample test for equality of proportions without continuity


correction

data: x out of n
X-squared = 6.1538, df = 1, p-value = 0.006556
alternative hypothesis: less
99 percent confidence interval:
-1.00000000 -0.00588084
sample estimates:
prop 1 prop 2
0.28 0.40

p-value = 0.006556 < 0.01 .


._

12

M ..:09104224

13

You might also like