6.3 Conduct a test of H0 : mul >= mu2 - 2.3 versus Ha : mul < mu2 -2.3 for the sample data summarized here. Use alpha = .01 in reaching your conclusions. Population 1 2 Sample size 13 21 Sample mean 50.3 58.6 Sample standard deviation 7.23 6.98

library(BSDA)
library(pwr)

99% Confidence Interval

tsum.test(mean.x = 50.3,s.x = 7.23,n.x = 13,mean.y = 58.6,s.y = 6.98,n.y = 21,mu=-2.3,alternative = "two.sided",var.equal = TRUE,conf.level = .99)
## 
##  Standard Two-Sample t-Test
## 
## data:  Summarized x and y
## t = -2.4031, df = 32, p-value = 0.02222
## alternative hypothesis: true difference in means is not equal to -2.3
## 99 percent confidence interval:
##  -15.137246  -1.462754
## sample estimates:
## mean of x mean of y 
##      50.3      58.6

-15.137246 -1.462754

Beta

pwr.t2n.test(n1 = 13, n2= 21, d = 7.23-6.98, sig.level = 0.01, power = NULL,alternative = "less")
## 
##      t test power calculation 
## 
##              n1 = 13
##              n2 = 21
##               d = 0.25
##       sig.level = 0.01
##           power = 0.001324102
##     alternative = less
1-0.02908793
## [1] 0.9709121

Power

pwr.t2n.test(n1 = 13, n2= 21, d = 7.23-6.98, sig.level = 0.01, power = NULL,alternative = "less")
## 
##      t test power calculation 
## 
##              n1 = 13
##              n2 = 21
##               d = 0.25
##       sig.level = 0.01
##           power = 0.001324102
##     alternative = less

0.02908793

Level of Significance

tsum.test(mean.x = 50.3,s.x = 7.23,n.x = 13,mean.y = 58.6,s.y = 6.98,n.y = 21,mu=-2.3,alternative = "less",var.equal = TRUE,conf.level = .99)
## 
##  Standard Two-Sample t-Test
## 
## data:  Summarized x and y
## t = -2.4031, df = 32, p-value = 0.01111
## alternative hypothesis: true difference in means is less than -2.3
## 99 percent confidence interval:
##         NA -2.186316
## sample estimates:
## mean of x mean of y 
##      50.3      58.6

With a Pvalue of 0.01111 being more than alpha = .01, there is enough evidence to suggest that the true difference in means is less than 2.3.

6.4 Refer to Exercise 6.3. a. What is the level of significance for your test? Level of significance is p-value = 0.01111

  1. Place a 99% confidence interval on mu1 - mu2.
tsum.test(mean.x = 50.3,s.x = 7.23,n.x = 13,mean.y = 58.6,s.y = 6.98,n.y = 21,mu=0,alternative = "two.sided",var.equal = TRUE,conf.level = .99)
## 
##  Standard Two-Sample t-Test
## 
## data:  Summarized x and y
## t = -3.3243, df = 32, p-value = 0.00223
## alternative hypothesis: true difference in means is not equal to 0
## 99 percent confidence interval:
##  -15.137246  -1.462754
## sample estimates:
## mean of x mean of y 
##      50.3      58.6

99 percent confidence interval: -15.137246 -1.462754

6.13 A firm has a generous but rather complicated policy concerning end-of-year bonuses for its lower-level managerial personnel. The policy’s key factor is a subjective judgment of “contribution to corporate goals.” A personnel officer took samples of 24 female and 36 male managers to see whether there was any difference in bonuses, expressed as a percentage of yearly salary. The data are listed here: Gender Bonus Percentage F 9.2 7.7 11.9 6.2 9.0 8.4 6.9 7.6 7.4 8.0 9.9 6.7 8.4 9.3 9.1 8.7 9.2 9.1 8.4 9.6 7.7 9.0 9.0 8.4 M 10.4 8.9 11.7 12.0 8.7 9.4 9.8 9.0 9.2 9.7 9.1 8.8 7.9 9.9 10.0 10.1 9.0 11.4 8.7 9.6 9.2 9.7 8.9 9.2 9.4 9.7 8.9 9.3 10.4 11.9 9.0 12.0 9.6 9.2 9.9 9.0 a. What are the populations of interest in this study? We are concerned with the bonuses for this firm’s lower level management personnel, male and female.

  1. Is there significant evidence that the mean bonus percentage for males is more than five units larger than the mean bonus percentage for females? Use alpha = .05. 95% Confidence Interval
bonus<-read.csv(file="ex6-13.txt", header = TRUE)
t.test(bonus$Male,bonus$Female,alternative = "two.sided",mu=5,paired = FALSE, var.equal = TRUE,conf.level = 0.95)
## 
##  Two Sample t-test
## 
## data:  bonus$Male and bonus$Female
## t = -13.514, df = 58, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 5
## 95 percent confidence interval:
##  0.5797451 1.7202549
## sample estimates:
## mean of x mean of y 
##  9.683333  8.533333

0.5797451 1.7202549

  1. What is the level of significance of your test?
t.test(bonus$Male,bonus$Female,alternative = "greater",mu=5,paired = FALSE, var.equal = TRUE,conf.level = 0.95)
## 
##  Two Sample t-test
## 
## data:  bonus$Male and bonus$Female
## t = -13.514, df = 58, p-value = 1
## alternative hypothesis: true difference in means is greater than 5
## 95 percent confidence interval:
##  0.6738034       Inf
## sample estimates:
## mean of x mean of y 
##  9.683333  8.533333

With a Pvalue of 1 being greater than alpha = .05, there is enough evidence to suggest that the mean bonus percentage for men is 5 units larger than the mean bonus percentage for women.

  1. Estimate the difference in the mean bonus percentages for males and females using a 95% confidence interval.
t.test(bonus$Male,bonus$Female,alternative = "two.sided",paired = FALSE, var.equal = TRUE,conf.level = 0.95)
## 
##  Two Sample t-test
## 
## data:  bonus$Male and bonus$Female
## t = 4.0367, df = 58, p-value = 0.0001609
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.5797451 1.7202549
## sample estimates:
## mean of x mean of y 
##  9.683333  8.533333

The difference in mean bonus percentage lies between 0.5797451 1.7202549

6.28 The paper “Effect of Long-Term Blood Pressure Control on Salt Sensitivity” [Journal of Medicine (1997) 28:147-156] describes a study evaluating salt sensitivity (SENS) after a period of antihypertensive treatment. Ten hypertensive patients (diastolic blood pressure between 90 and 115 mmHg) were studied after at least 18 months on antihypertensive treatment. SENS readings, which were obtained before and after the patients were placed on an antihypertensive treatment, are given here. Patient 1 2 3 4 5 6 7 8 9 10 Before treatment 22.86,7.74,15.49,9.97,1.44,9.39,11.40,1.86,-6.71,6.42 After treatment 6.11,-4.02,8.04,3.29,-0.77,6.99,10.19,2.09,11.40,10.70 a. Is there significant evidence that the mean SENS value decreased after the patient received antihypertensive treatment?

sens <- read.csv(file="ex6-28.txt", header = TRUE)
t.test(sens$B,sens$A,alternative = "two.sided",paired = TRUE, var.equal = FALSE,conf.level = 0.95)
## 
##  Paired t-test
## 
## data:  sens$B and sens$A
## t = 0.86098, df = 9, p-value = 0.4116
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -4.205261  9.373261
## sample estimates:
## mean of the differences 
##                   2.584

95 percent confidence interval: -4.205261 9.373261

t.test(sens$B,sens$A,alternative = "less",paired = TRUE, var.equal = FALSE,conf.level = 0.95)
## 
##  Paired t-test
## 
## data:  sens$B and sens$A
## t = 0.86098, df = 9, p-value = 0.7942
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
##      -Inf 8.085599
## sample estimates:
## mean of the differences 
##                   2.584

Using a 95% confidence, we have a p value of .7942, which is greater than alpha. Therefore, there is no sufficient evidence to reject the null that the mean SENS value has not significantly decreased.

  1. Estimate the size of the change in the mean SENS value. The mean of the differences is 2.584

  2. Do the conditions required for using the t procedures appear to be valid for these data? Justify your answer.

qqnorm(sens$B,ylab="Values",xlab="Before",main="Normal Probability Plot")
qqline(sens$B)

qqnorm(sens$A,ylab="Values",xlab="After",main="Normal Probability Plot")
qqline(sens$A)

No, they do not appear to be valid. Looking at the normal probability plot,one can look at the data and see that overall, the values do not fall within a trending upward line, so the difference in means are not normally distributed, especially thebefore data.

6.37 A study is being planned to evaluate the possible side effects of an anti-inflammatory drug. It is suspected that the drug may lead to an elevation in the blood pressure of users of the drug. A preliminary study of two groups of patients, one receiving the drug and the other receiving a placebo, provides the following information on the systolic blood pressure (in mm Hg) of the two groups: Group Mean Standard Deviation Placebo 129.9 18.5 Anti-inflammatory drug 135.5 18.7 Assume that both groups have systolic blood pressures that have a normal distribution with standard deviations relatively close to the values obtained in the pilot study. Suppose the study plan provides for the same number of patients in the placebo group as in the treatment group. Determine the sample size necessary for an alpha = .05 t test to have a power of .80 to detect an increase of 5 mm Hg in the blood pressure of the treatment group relative to that of the placebo group.

power.t.test(n=NULL,delta=5,sd=18.6,sig.level = .05,power = .8,type = c("two.sample"),alternative = c("one.sided"))
## 
##      Two-sample t test power calculation 
## 
##               n = 171.7938
##           delta = 5
##              sd = 18.6
##       sig.level = 0.05
##           power = 0.8
##     alternative = one.sided
## 
## NOTE: n is number in *each* group

Sample size needed is 172

6.38 Refer to Exercise 6.37 . Suppose that the agency sponsoring the study specifies that the group receiving the drug should have twice as many patients as the placebo group. Determine the sample sizes necessary for an alpha = .05 t test to have a power of .80 to detect an increase of 5 mm Hg in the blood pressure of the treatment group relative to that of the placebo group.

sd<-18.6
n<-3/2 * sd^2 * ((qnorm(.05, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)+qnorm(.2, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE))^2)/5^2
n
## [1] 128.335

Sample size for the first sample is 129

2 * n
## [1] 256.6701

Sample size for the second sample is 257