R Markdown

Question 1

Given: $ mu=109, n=190, xbar= 110, sd=6, sigma=.05$.

i. Null and Alternative Hypothesis

Ho: \(\mu = 109\)

Ha: $ $

ii. Choose level of significnce

$= .05 $

iii. Test Statistic

Distribution: z

v. Take sample and decide

teststat <- (110-109)/ (6/sqrt(190))
criticalvalue <- qnorm(p=.975,
                       mean=0,
                       sd=1)
print(teststat)
## [1] 2.297341
print(criticalvalue)
## [1] 1.959964

Decision

test stat is greater than critical value. REJECT

Question 2

Given: $ mu=5.3, n=5, xbar= 5.0, sd=1.1, sigma=.05$.

i. Null and Alternative Hypothesis

Ho: \(\mu = 5.3\)

Ha: \(\mu \neq 5.3\)

ii. Choose level of significnce

$= .05 $

iii. Test Statistic

Distribution: t

v. Take sample and decide

teststat2 <- (5-5.3)/ (1.1/sqrt(5))
criticalvalue2 <- qt(p=.025, df=4, lower.tail = FALSE)
print(teststat2)
## [1] -0.6098367
print(criticalvalue2)
## [1] 2.776445

Decision

test stat is less than critical value. CANT REJECT

Question 3

Given: $ mu=7.3, n=51, xbar= 7.1, variance=.49, alpha=.01$.

i. Null and Alternative Hypothesis

Ho: \(\mu = 7.3\)

Ha: $ $

ii. Choose level of significnce

$= .01, /2=.005 $

iii. Test Statistic

Distribution: t

v. Take sample and decide

teststat3 <- (7.1-7.3)/ (.7/sqrt(51))
criticalvalue3 <- qt(p=.005, df=50, lower.tail = FALSE)
print(teststat3)
## [1] -2.040408
print(criticalvalue3)
## [1] 2.677793

Decision

test stat is less than critical value. CANT REJECT

Question 4

Given: $ phat= 29/100, n=100, pi=36/100, alpha=.02$.

i. Null and Alternative Hypothesis

Ho: pi is greater than or equal to 36/100

Ha: pi less than 36/100

ii. Choose level of significnce

$= .02 $

iii. Test Statistic

Distribution: z

v. Take sample and decide

teststat4 <- (.29-.36)/.048
criticalvalue4 <- qnorm(p=.02, mean=0, sd=1, lower.tail = TRUE)
print(teststat4)
## [1] -1.458333
print(criticalvalue4)
## [1] -2.053749

Decision

test stat is less than critical value. CANT REJECT

Question 5

Given: $ phat= 95/380, n=380, pi=.31, alpha=.05$.

i. Null and Alternative Hypothesis

Ho: pi is greater than or equal to .31

Ha: pi is less than .31

ii. Choose level of significnce

$= .05 $

iii. Test Statistic

Distribution: z

v. Take sample and decide

criticalvalue5 <- qnorm(p=.05, mean=0, sd=1)
sqrt(.31*(1-.31))
## [1] 0.4624932
sqrt(380)
## [1] 19.49359
.462/19.493
## [1] 0.02370082
teststat5 <- (.25-.31)/ (.0237)
print(teststat5)
## [1] -2.531646
print(criticalvalue5)
## [1] -1.644854

Decision

test stat is greater than critical value. CAN REJECT

Question 7

Given: $ xbar1= 112, sd1=24, n1=22, xbar2=102, sd2= 15.4387, n2= 22, alpha=.01$.

i. Null and Alternative Hypothesis

Ho: sd is greater than or equal to .24

Ha: sd is less than .24

ii. Choose level of significnce

$= .01 $

iii. Test Statistic

Distribution: t

v. Take sample and decide

criticalvalue7 <- qt(p = .995, df = 21)

delta7 <- 112-102
24^2
## [1] 576
15.4387^2
## [1] 238.3535
sqrt(576/22) + sqrt(283.25/22)
## [1] 8.704992
teststat7 <- 10/8.704
print(teststat7)
## [1] 1.148897
print(criticalvalue7)
## [1] 2.83136

Decision

test stat is less than critical value. CANT REJECT

Question 8

Given: $ mu1= 87, sd1=9, n1=32, mu2=84, sd2= 10, n2= 31, alpha=.01$.

i. Null and Alternative Hypothesis

Ho: $ mu1-mu2=0 $

Ha: $ mu1-mu2 $

ii. Choose level of significnce

$= .01 $

iii. Test Statistic

Distribution: t

v. Take sample and decide

mu1 <- 87
mu2 <- 84

alpha   =   .1

n1    =   32
n2    =   31

df1   =   n1 - 1
df2   =   n2 - 1

sd1   = 9
sd2   = 10

var1  = sd1^2
var2  = sd2^2

numpointestimatediff = (mu1 - mu2 )
Se8 = sqrt( var1/n1 + var2/n2 )

teststat8 = (numpointestimatediff) / Se8
print(teststat8)
## [1] 1.25032
numdf = (var1/n1 + var2/n2)^2         
dendf = (var1/n1)^2 / df1 + (var2/n2)^2 / df2       
df = numdf / dendf 

criticalvalue8 <- qt(p = (1-alpha/2), df = numdf / dendf )
print(criticalvalue8)
## [1] 1.670703

Decision

test stat is less than critical value. CANT REJECT

Question 9

Given: $ xbar1= 127, sd1=33, n1=11, xbar2=157, sd2= 27, n2= 18, alpha=.05$.

i. Null and Alternative Hypothesis

Ho: $ xbar1-xbar2=0 $

Ha: $ xbar1-xbar2 $

ii. Choose level of significnce

$= .01 $

iii. Test Statistic

Distribution: t

v. Take sample and decide

xbar9<- 127
xbar10 <- 157

alpha   =   .05

n9    =   11
n10   =   18

df9  =   n9 - 1
df10  =   n10 - 1

sd9   = 33
sd10   = 27

var9  = sd9^2
var10  = sd10^2

numpointestimatediff = (mu1 - mu2 )
Se9 = sqrt( var9/n9 + var10/n10 )

delta = -30

teststat9 = delta / Se9
print(teststat9)
## [1] -2.540003
numdf9 = (var9/n9 + var10/n10)^2         
dendf9 = (var9/n9)^2 / df9 + (var10/n10)^2 / df10       
df9 = numdf9 / dendf9 

criticalvalue9 <- qt(p = alpha/2, df = numdf9 / dendf9)
print(criticalvalue9)
## [1] -2.10029

Decision

test stat is greater than critical value. CAN REJECT

Question 10

Given: n=10

i. Null and Alternative Hypothesis

Ho: $ xbar1-xbar2=0 $

Ha: $ xbar1-xbar2 $

ii. Choose level of significnce

$= .99 $

iii. Test Statistic

Distribution: t

v. Take sample and decide

r1 = c(32,27,34,24,31,25,30,23,27,35)
r2 = c(28,28,33,25,26,29,33,27,25,33)
delta9 = r1-r2

xbar11 = mean(delta9)

teststat10= qt(p = .99, df = 9)
print(teststat10)
## [1] 2.821438
Se= sd(delta9) / sqrt(length(delta9))

interval = c( xbar11 - teststat10 * Se, xbar11 + teststat10 * Se)
print(interval)
## [1] -2.766534  2.966534

Decision

The 98% confidence interval is from -2.766 to 2.966

Question 11

Given: $ xbar1= 127, sd1=33, n1=11, xbar2=157, sd2= 27, n2= 18, alpha=.05$.

i. Null and Alternative Hypothesis

Ho: $ pi1-pi2=0 $

Ha: $ pi1-pi2 $

ii. Choose level of significnce

$= .05 $

iii. Test Statistic

Distribution: z

v. Take sample and decide

criticalvalue11 <- qnorm(p=.05, lower.tail = FALSE )
print(criticalvalue11)
## [1] 1.644854
p1=195/391
p2=193/510
p1-p2
## [1] 0.1202899
Se11 = sqrt (p1 * (1-p1) / 391 + p2 * (1-p2) / 510)
teststat11 <- (p1-p2)/ Se11
print(teststat11)
## [1] 3.625887

Decision

Test stat is greater than critical value. REJECT