Sunteți pe pagina 1din 4

16.

9
a.
> Below_Average = c(29, 42, 48, 40, 43, 40, 30, 42)
> Average = c(30, 35, 39, 28, 31, 31, 29, 35, 29, 33)
> Above_Average = c(26, 32, 21, 20, 23, 22)
> n1 = length(Below_Average)
> n2 = length(Average)
> n3 = length(Above_Average)
> plot(rep(c(1, 2, 3), c(n1, n2, n3)), c(Below_Average, Average, Above_Averag
e), main="Aligned Dot Plot",
+ xlab = "Rehab (1=Below Averge, 2=Average, 3=Above Average)", ylab = "D
ays")

The factor level means do appear to differ. The Variability of observations within each factor level do not
appear to be approximately the same for all factor levels.

b.
> Below_Average_bar = mean(Below_Average); Average_bar = mean(Average);Above_
Average_bar = mean(Above_Average);
> Below_Average_bar
[1] 39.25
> Average_bar
[1] 32
> Above_Average_bar
[1] 24

c.
> e1 = Below_Average - Below_Average_bar
> e2 = Average - Average_bar
> e3 = Above_Average - Above_Average_bar
> e1
[1] -10.25 2.75 8.75 0.75 3.75 0.75 -9.25 2.75
> e2
[1] -2 3 7 -4 -1 -1 -3 3 -3 1
> e3
[1] 2 8 -3 -4 -1 -2
> sum(e1)
[1] 0
> sum(e2)
[1] 0
> sum(e3)
[1] 0
They do sum to zero.

d.
> Y = c(Below_Average, Average, Above_Average)
> nT = length(Y)
> Ybar = mean(Y)
> SSTR = n1*(Below_Average_bar - Ybar)^2 + n2*(Average_bar - Ybar)^2 + n3*(Ab
ove_Average_bar - Ybar)^2
> SSE = sum(c(e1^2, e2^2, e3^2))
> SST = sum((Y - Ybar)^2)
> SSTR_df = 3 -1; SSE_df = nT - 3; SSTO_df = nT - 1
> MSTR = SSTR/SSTR_df
> MSE = SSE/SSE_df
> F_stat = MSTR/MSE

e.

Null hypothesis: The number of days required to completion of physical therapy does not affected by
prior fitness status.

Alternative hypothesis: The number of days required to completion of physical therapy does affected by
prior fitness status.

If the p-value is smaller than the significant level stats, than we reject the null hypothesis, and if the
critical value is larger than significance level, we reject the null hypothesis.
> Y
[1] 29 42 48 40 43 40 30 42 30 35 39 28 31 31 29 35 29 33 26 32 21 20 23 22
> nT
[1] 24
> Ybar
[1] 32.41667
> SSTR
[1] 800.3333
> SSE
[1] 503.5
> SST
[1] 1303.833
> SSTR + SSE
[1] 1303.833
> SSTR_df
[1] 2
> SSE_df
[1] 21
> SSTO_df
[1] 23
> MSTR
[1] 400.1667
> MSE
[1] 23.97619
> F_stat
[1] 16.69017

f.
> qf(0.99, SSTR_df, SSE_df)
[1] 5.780416
> F_stat
[1] 16.69017
Since the F-stat which is critical value larger than the qf(0.99, SSTR_df, SSE_df), we reject
the null hypothesis

The both p-value approach and critical value approach always reach the same conclusion.

g.

the nature relationship appears to be the better prior physical therapy status the shorter the completion
time is.

16.26
> sigma = 4.5
> mu1 = 37
> mu2 = 35
> mu3 = 28
> mu = (mu1*n1*mu2*n2*mu3*n3)/nT
> mu
[1] 725200
phi = 1/sigma*sqrt((n1*(mu1-mu)^2+n2*(mu2-mu)^2+n3*(mu3-mu)^2)/3)
> phi
[1] 455795.4
> v1 = 3-1
> v2 = nT - 3
> v1
[1] 2
> v2
[1] 21

17.9
a.
Bar Graph
30

29.5

29

28.5

28

27.5

27
Blue Green Orange

Bar Graph

The plot suggests that Blue and Green get higher response rate.

See next page for rest.

S-ar putea să vă placă și