### Calculating P-values in R

Notes below are documented for future reference should I ever need to use them again someday. A pharmaceutical company is interested in testing a potential blood pressure lowering medication. Their first examination considers only subjects that received the medication at baseline then two weeks later. The data are as follows (SBP in mmHg) SubjectBaselineWeek 211401322138135315015141481465135130Consider testing the hypothesis that there was a mean reduction in blood pressure? Give the P-value for the associated two sided T test. (Hint, consider that the observations are paired).

*Solution:*baseline<- span=""> c(140,138,150,148,135)week2<-c(132,135,151,146,130)round(t.test(baseline,week2, paired=TRUE)$p.value,3)## [1] 0.087Researchers conducted a blind taste test of Coke versus Pepsi. Each of four people was asked which of two blinded drinks given in random order that they preferred. The data was such that 3 of the 4 people chose Coke. Assu