You are on page 1of 3

> x=rgamma(50,1,1)

> qqnorm(x); qqline(x, col=2)


11.b) They could not hae come !rom a normal di"tribution becau"e the dot" do not !orm a "traight line.
2.1)#hen ty$ing in mean(x) % got an out$ut o! 1.&5. Thi" i" ex$ected becau"e in ' i" the mean in the
di"tribution.
- 2 - 1 0 1 2
0
1
2
3
4
5
6
N o r m a l Q - Q P l o t
T h e o r e t i c a l Q u a n t i l e s
S
a
m
p
l
e

Q
u
a
n
t
i
l
e
s
2.2)(utcome)
> table(x)*1000
x
0 1 2 + '
0.0,1 0.25' 0.+-2 0.255 0.05.
% "hould ex$ect thi" outcome becau"e the rbinom() !unction generate" random ariable" !or a certain
number o! ex$eriment", /ith a certain number o! ob"eration" $er ex$eriment", and the $robability o!
"ucce"" o! each o! tho"e ex$eriment". #hen /e u"ed the table(x)*1000 !unction it ba"ically changed the
original 1000 ex$eriment" /e had to a one then $ut thi" in a table. Thi" can be u"ed to "ee the
con"i"tency in a "am$le $o$ulation " the /hole $o$ulation.
+.1)The $o$ulation di"tribution" !or x and y i" 0(1)(mean) and the ariance i" ar(2) 3 4ar(5)3
206(270(2))(570(5))8
+.2) > "et."eed=11;x=runi!(10000);y=runi!(10000)
> ar(x3y);ar(x7y)
618 0.1-+1-+.
618 0.1--+.-
> "et."eed=11;x=runi!(10000);y=runi!(10000)
> ar(x3y);ar(x7y)
618 0.1-&&-'.
618 0.1-5',0,
The "am$le "i9e that /a" u"ed i" 10000. :rom the"e t/o data $oint" it i" ea"y to "ee that the "am$le
ariance;" a$$roximate the "ame quantity
+.+)<ll command" u"ed are $o"ted aboe
'.1) =inomal di"tribution /ith a ariance equal to n$($71)
'.2) > x=rbinom(10000,+,.-)
> mean(x)
618 1..11.
> ar(x)
618 0.,1'2522
> "d(x)
618 0..'51+''
The "am$le ariance i" .0,1'
The "am$le "tandard deiation i" ..'5
'.+)
> a=.,1'52
> b=..'51+'
> !=a3b
> !
618 1.55&-5'
> mean(!)
618 1.55&-5'
> !=(a3b)*(2)
> !
618 0.,,&.2,
#hen ta>ing the $o$ulation mean and ariance it i" ea"y to "ee that they are "imilar to the "am$le
mean and ariance.

You might also like