Description
Patrick Gardocki
6-30
octane = read.table(“6-30.txt”,header = TRUE) octane=octane$Rating o = sort(octane) quantile(o, c(0.25,0.5,0.75),type=6)
## 25% 50% 75%
## 88.575 90.400 92.200
stem(octane, scale=2)
##
## The decimal point is at the |
##
## 83 | 4
## 84 | 33
## 85 | 3
## 86 | 777
## 87 | 456789
## 88 | 23334556679
## 89 | 0233678899
## 90 | 0111344456789
## 91 | 0001112256688
## 92 | 22236777
## 93 | 023347
## 94 | 2247
## 95 |
## 96 | 15
## 97 |
## 98 | 8
## 99 |
## 100 | 3
6-46
octane = read.table(“6-30.txt”,header = TRUE) octane=octane$Rating obj = hist(octane,breaks=8)
Histogram of octane
85 90 95 100
octane
length(octane)
## [1] 82
library(knitr) library(kableExtra)
df = data.frame(Frequency = obj$counts)
n=length(obj$breaks) for(i in 1:(n-2)){ df$Class[i]=paste(obj$breaks[i],”$\le x <$”, obj$breaks[i+1])
} df$Class[n-1] = paste(obj$breaks[n-1],”$\le x \le$”, obj$breaks[n])
Table 1: Frecquency Distribution Table
Class Frequency Relative Frequency Cumulative Frequency Cumulative Relative Frequency
82 ≤ x < 84 1 0.0121951 1 0.0121951219512195
84 ≤ x < 86 3 0.0365854 4 0.0487804878048781
86 ≤ x < 88 9 0.1097561 13 0.158536585365854
88 ≤ x < 90 22 0.2682927 35 0.426829268292683
90 ≤ x < 92 25 0.3048780 60 0.731707317073171
92 ≤ x < 94 14 0.1707317 74 0.902439024390244
94 ≤ x < 96 4 0.0487805 78 0.951219512195122
96 ≤ x < 98 2 0.0243902 80 0.975609756097561
98 ≤ x < 100 1 0.0121951 81 0.98780487804878
100 ≤ x ≤ 102 1 0.0121951 82 1
df$”Relative Frequency”= obj$density*2 for(i in 1:(n-1)){ df$”Cumulative Frequency”[i]=paste(cumsum(obj$counts)[i]) df$”Cumulative Relative Frequency”[i]=paste(cumsum(obj$density*2)[i])
} kable(df[c(2,1,3,4,5)], “latex”, align=”c”, caption=”Frecquency Distribution Table”,
escape = FALSE)
6-81
Expr = read.table(“6-81.txt”,header = TRUE) attach(Expr)
boxplot(Expression~Group, main=”Boxplot of 4 Groups”, xlab=”Group”, ylab=”Expression”)
Boxplot of 4 Groups
Group
The control groups seem to have the same median value but drastically different variances. The ‘high dose’ group has a mush smaller variance and slightly lower median expression as well.
6-98
octane = read.table(“6-30.txt”,header = TRUE)
octane=octane$Rating qqnorm(octane) qqline(octane)
Normal Q−Q Plot
Theoretical Quantiles
The Normal Probability plot suggests that the data is normally distributed but seems to break down at both ends of the data range.
7-12
µX = 8.2 minutes, n = 49, σX = 1.5 minutes, σ Under Central Limit Theorem, X¯ is approx. normally distributed.
(a)
P(X <¯ 10) = P(Z < 10σ−X¯µ) = P(Z < 8.4) = 1
(b)
P(5 < X <¯ 10) = P(5σ−X¯µ < Z < 10σ−X¯µ) = P(Z < 8.4) − P(Z < −14.932) = 1 − 0 = 1
(c)
P(X <¯ 6) = P(Z < 6σ−X¯µ) = P(Z < −10.27) = 0
7-37
a)
if E(Θ) = Θˆ then unbiased estimator
E(Xˆ1 − Xˆ2) = E(Xˆ1) − E(Xˆ2) = µ1 − µ2 ∴ unbiased
b)
q ˆ qV (Xˆ1 − Xˆ2) = qV (Xˆ1) + V (Xˆ2) + 2COV (Xˆ1,Xˆ2) = qnσ121 + nσ222 σX¯ = V (Θ) =
Estimating the standard error could be done by replacing the variance, σ with sample standard deviation,
S.
c)
S
E
7-44
f(x) = p(1 − p)x−1
n
P xi−n n
L(p) = Q p(1 − p)xi−1 = pn(1 − p)i=1
i=1
n
l(p) = nln(p) + (P xi − n)ln(1 − p)
i=1
n n
P xi−n n(1−p)−p P xi−n
n
∂l = 0 = n − i=1 = i=1 = n − p P x
∂u p 1−p p(1−p) i ∴
i=1
pˆ = nn
P xi
i=1
8-1
a)
z0 = 2.14 → P(Z < 2.14) = 0.9838 ∴ α = 2 × (1 − 0.9838) → CI = 100 × (1 − α) = 96.76% b)
z0 = 2.49 → P(Z < 2.49) = 0.9838 ∴ α = 2 × (1 − 0.9963) → CI = 100 × (1 − α) = 98.72%
c)
z0 = 1.85 → P(Z < 1.85) = 0.9678 ∴ α = 2 × (1 − 0.9678) → CI = 100 × (1 − α) = 93.56% d)
z0 = 2.00 → P(Z < 2.00) = 0.9772 ∴ α = (1 − 0.9772) → CI = 100 × (1 − α) = 97.72% e)
z0 = 1.96 → P(Z < 1.96) = 0.9750 ∴ α = (1 − 0.9750) → CI = 100 × (1 − α) = 97.50%
8-41
a)
speed = c(3.775302, 3.350679, 4.217981, 4.030324, 4.639692, 4.139665, 4.395575, 4.824257, qqnorm(speed) qqline(speed)
4.268119, 4.58
Normal Q−Q Plot
Theoretical Quantiles
library(nortest) ad.test(speed)
##
## Anderson-Darling normality test
##
## data: speed
## A = 0.23339, p-value = 0.7448
Based on the plot, the data seems to follow a Normal distribution.
b)
s t0.025,12 √n
µ = 4.313; s = 0.4328; n = 13; t0.025,12 = 2.179
4. → 4.051 ≤ µ ≤ 4.575
mean(speed)
## [1] 4.313222
sd(speed)
## [1] 0.4328017
length(speed)
## [1] 13
qt(.025,12)
## [1] -2.178813
qt(.05,12)
## [1] -1.782288
c)
µ
µ = 4.313; s = 0.4328; n = 13; t0.05,12 = 1.782
4. → 4.099 ≤ µ
8-53
temp = c(23.3, 21.7, 21.6, 21.7, 21.3, 20.7, 20.9, 20.1) qqnorm(temp) qqline(temp)
Normal Q−Q Plot
Theoretical Quantiles
library(nortest) ad.test(temp)
##
## Anderson-Darling normality test
##
## data: temp
## A = 0.35247, p-value = 0.3666
sd(temp)
## [1] 0.9463275
length(temp)
## [1] 8
n = 8; s = 0.9463
→ 0.626 ≤ σ ≤ 1.926
Based on the plot, the data seems to follow a Normal distribution.
Q2
a)
PXi PYj
n + m PXi PYj 1 1 PXi) + m1 E(PYj)
for µ1: E( 2 ) =E( n ) + E( m ) = 2 nE( unbiased
for µ2: E(PXni++mPYj 1 PXi) + E(PYj)) = n+1m (nµ + mµ) =unbiased ) = n+m (E(
b)
PXi PYj
+ for µ1: V ar( n 2 m ) = 12
1 mσ2 nσ2 σ2
2( nm + nm ) = 2nm(n + m)
P P (
n12V ar PXi) + m12V ar(PYj) = 21 n12nσ2 + m12mσ2
for µ2: V ar( Xi+ Yj ) = 1 (V ar(PXi) + V ar(PYj)) = n+1m(nσ2 + mσ2) = σ2 n+m n+m
c)
Relative Efficiency: MSEMSE ((µµˆˆ12))
σ2(n+m)
2
MSE(µˆ1) = V ar(µˆ1) − Bias ∴ Relative Efficiency = V arV ar((µµˆˆ21)) = 2σnm2 = n2+nmm
d)
Based on relative efficiency being less than 1, µˆ1 is the better estimator.
1 σ2 σ2
= 2( n + m ) =




Reviews
There are no reviews yet.