drug_a<-c(4.9,1.3,10.9,4.7,6.5,4.6,9.5)
drug_b<-c(4.2,2.1,7.4,3.6,7.2,1.6,7.9)
def<-c(0.7,-0.8,3.5,1.1,-0.7,3,1.6)

develop a data frame

med<-data.frame(drug_b,drug_a,def)
head(med)
##   drug_b drug_a  def
## 1    4.2    4.9  0.7
## 2    2.1    1.3 -0.8
## 3    7.4   10.9  3.5
## 4    3.6    4.7  1.1
## 5    7.2    6.5 -0.7
## 6    1.6    4.6  3.0
dim(med)
## [1] 7 3

mean,standard deviation and n

d<-mean(med$def)
sd<-sd(med$def)

t calculated

tcal<-d/(sd/2.6)
tcal
## [1] 1.878019

NOTE

Df=7-1=6 alpha=0.05

RECOMMENDATION

critical value is 2.447 therefore tcal(1.8780) has fallen in the non rejection region,we fail to reject the null hypothesis(HO) at sym(“alpha”) of 0.05 with a chance of 5% of commiting error Type 11

CONCLUSION

there is no significant difference between effectiveness of the two pain killers .Infact the two pain killers are same.

curve(dnorm(x),xlim = c(-4,4),main='rejection region  of a two tailed test',yaxis='i',xlab = 't-statistc',ylab = '',lwd=2,axes='F')
## Warning in plot.window(...): "yaxis" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "yaxis" is not a graphical parameter
## Warning in title(...): "yaxis" is not a graphical parameter
axis(1,at=c(-4,sym("theta"),2.44,4),padj = 0.5,labels = c('',sym("theta"),expression(Phi^-1~(.95)==2.44),''))
## Warning in axis(1, at = c(-4, sym("theta"), 2.44, 4), padj = 0.5, labels =
## c("", : NAs introduced by coercion
polygon(x=c(2.44,seq(2.44,4,0.01),4),y=c(0,dnorm(seq(2.44,4,0.01)),sym("theta")),col = 'blue')
## Warning in xy.coords(x, y, setLab = FALSE): NAs introduced by coercion

#polygon(x=c(-2.44,seq(-2.44,-4,-0.01),-4),y=c(0,dnorm(seq(2.44,4,0.01)),sym("theta")),col = 'blue')
E<-expression(theta,parse=TRUE)
E
## expression(theta, parse = TRUE)

```