Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

4. Suppose that the diagnosis procedure for a certain disease involves taking da

ID: 3268250 • Letter: 4

Question

4. Suppose that the diagnosis procedure for a certain disease involves taking daily measurements,
over a 31 day period, of the concentration of a particular compound in patients’
blood. If the average concentration of this compound in a given patient’s blood is more
than 2%, the patient is diagnosed with the disease. Use the following R code to obtain a
sample of 30 measurements of the concentration of this compound in a patient’s blood.
(You don’t need to provide the values.)
CCs = rnorm(30,runif(1,1.85,2.05),runif(1,0.6,0.8))

(a) (3 points) Calculate the sample average, variance, and standard deviation. If you
use R, also provide the code you use.

(b) (3 points) Find a 99% confidence interval for the mean concentration. If you use
R, provide your code.

(c) (8 points) Perform a hypothesis test at significance level = 0.005 to evaluate
whether the patient’s true mean compound concentration was more than 2%. Report
your critical value, test statistic, conclusion, and p-value.

(d) (7 points) What is the probability that the patient is misdiagnosed by this test?
(Hint: that means saying they have the disease when they don’t OR saying they
don’t have it when they do.) (Another hint: You may want to reference section
8.4.)

Explanation / Answer

a)

CCs = rnorm(30,runif(1,1.85,2.05),runif(1,0.6,0.8))
mean(CCs)
sd(CCs)
var(CCs)


b)

t.test(CCs,mu = 2,conf.level = 0.99)

c)


t.test(CCs,mu = 2,conf.level = 0.995,alternative="greater")

After running the code

CCs = rnorm(30,runif(1,1.85,2.05),runif(1,0.6,0.8))

> mean(CCs)
[1] 2.203723
> sd(CCs)
[1] 0.6736556
> var(CCs)
[1] 0.4538118
>
> t.test(CCs,mu = 2,conf.level = 0.99)

One Sample t-test

data: CCs
t = 1.6564, df = 29, p-value = 0.1084
alternative hypothesis: true mean is not equal to 2
99 percent confidence interval:
1.864709 2.542736
sample estimates:
mean of x
2.203723

>
> t.test(CCs,mu = 2,conf.level = 0.995,alternative="greater")

One Sample t-test

data: CCs
t = 1.6564, df = 29, p-value = 0.05421
alternative hypothesis: true mean is greater than 2
99.5 percent confidence interval:
1.864709 Inf
sample estimates:
mean of x
2.203723

since p-value > 0.005

we fail to reject the null hypothesis

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote