How to Compare Before and After Blood Pressure Readings in Excel With a T Test
How to run a T-test
install.packages("gdata")
Installing bundle into '/Users/jaclynbazsika/Library/R/3.3/library' (equally 'lib' is unspecified) also installing the dependency 'gtools' trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/iii.3/gtools_3.5.0.tgz' Content type 'awarding/x-gzip' length 134356 bytes (131 KB) ================================================== downloaded 131 KB trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/three.iii/gdata_2.17.0.tgz' Content type 'application/x-gzip' length 1136842 bytes (1.ane MB) ================================================== downloaded 1.1 MB
The downloaded binary packages are in /var/folders/8s/6xnh03sd7zzc1nny5h0xzx3h0000gn/T//RtmpoRfMSo/downloaded_packages
library(gdata)
gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED. gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED. Attaching bundle: 'gdata' The post-obit object is masked from 'package:stats': nobs The following object is masked from 'package:utils': object.size The following object is masked from 'package:base': startsWith
my.data = read.xls("/Users/jaclynbazsika/Documents/paired t-test_3.xlsx")
my.data
In the following experiment, the information depicts the results of a study taken by 12 random individuals. It shows thier blood pressure taken earlier and after a non-interventional study for XYZ and ABC drug. The purpose was to determine whether the drugs had a positive, negative or nuetral event on the participants. A positive issue would mean that the drug lowered BP. A negative effect would mean it did not lower BP.
Start_BP= c(155,142,145,160,149,152,157,159,166,163,158,161) XYZ_BP= c(152,142,144,159,150,153,156,160,165,162,159,160) t.exam(Start_BP,XYZ_BP,paired = TRUE)
Paired t-exam information: Start_BP and XYZ_BP t = 1.1639, df = 11, p-value = 0.2691 alternative hypothesis: truthful difference in means is non equal to 0 95 percent conviction interval: -0.3712632 1.2045965 sample estimates: mean of the differences 0.4166667
In this paired, one-sided t-test, we compared the starting blood pressure of the XYZ drug group. This paired t-test examines whether there is a divergence in the starting BP vs. the BP subsequently the drug was administered. Given the data, the results do not indicate a significant difference in results. Therefore, nosotros tin can take the nullhypothesis, in that there is petty to no difference between the two variables. The P-value is greater than 0.05.
Start_BP= c(155,142,145,160,149,152,157,159,166,163,158,161) XYZ_BP= c(152,142,144,159,150,153,156,160,165,162,159,160) t.test(Start_BP,XYZ_BP,paired = Truthful, alt="less")
Paired t-test data: Start_BP and XYZ_BP t = 1.1639, df = xi, p-value = 0.8655 alternative hypothesis: true difference in means is less than 0 95 percent confidence interval: -Inf ane.059575 sample estimates: hateful of the differences 0.4166667
In this paired, two-sided t-examination, we hypothesized that the Start_BP was less than the XYZ_BP. We are rejecting the null, but accepting the alternative because the starting BP is greater XYZ BP. Therefore, we take a p-value of 0.8655, which is college than 0.05.
Start_BP= c(155,142,145,160,149,152,157,159,166,163,158,161) XYZ_BP= c(152,142,144,159,150,153,156,160,165,162,159,160) t.test(Start_BP,XYZ_BP,paired = TRUE, alt="greater")
Paired t-test data: Start_BP and XYZ_BP t = 1.1639, df = 11, p-value = 0.1345 alternative hypothesis: true deviation in means is greater than 0 95 percent confidence interval: -0.2262415 Inf sample estimates: mean of the differences 0.4166667
Here, nosotros did a two-sided, paired t-exam. Our alternative hypothesis states that the intital BP. Given the sample set, we are able to run across that the starting BP was in fact higher than the BP taken at the end of the drug trial. We therefore can accept the cipher, since the p-value is greater than 0.05.
#load data ABC trial ABC_trial= c(150,135,142,153,142,147,152,149,158,155,150,150)
#i-sided t-test Start_BP= c(155,142,145,160,149,152,157,159,166,163,158,161) ABC_trial= c(150,135,142,153,142,147,152,149,158,155,150,150) t.test(Start_BP,ABC_trial,paired = True)
Here, nosotros shift gears and exercise another paired, one-sided t-exam.We wanted to come across if there was a departure between the starting BP of XYZ and the ABC trial. Given the sample prepare, we tin tell that at that place is in fact a departure between the two groups, and a p-value of iii.582e-07 therefore, we reject the zilch hypothesis.
Start_BP= c(155,142,145,160,149,152,157,159,166,163,158,161) ABC_trial= c(150,135,142,153,142,147,152,149,158,155,150,150) t.test(Start_BP,ABC_trial,paired = True, alt="greater")
In this examination, we evaluated whether the Start_BP was greater compared to the ABC trial. Nosotros were able to reject the null hypothesis, given the p-value i.791e-07, and have the culling hypothesis, which suggests that the BP for XYZ is higher than ABC.
t.exam(ABC_trial,Start_BP, paired = TRUE, alt="less")
Paired t-examination data: ABC_trial and Start_BP t = -x.747, df = xi, p-value = 1.791e-07 alternative hypothesis: truthful departure in means is less than 0 95 percent confidence interval: -Inf -v.83027 sample estimates: hateful of the differences -7
hist(Start_BP)
hist(XYZ_BP)
hist(ABC_trial)
In the final exam, we hypothesized that the BP in ABC_trial was lower than Start_BP. Nosotros rejected the null hypothesis given the p-value 1.791e-07, and accepted the alternative hypothesis, in that the BP was in fact lower at te decision of ABC trial.
Conclusion:
We can ascertain that the drug trial did have a positive effect on participants. Data from the intial BP reading shows that BP was higher compared to the final reading from each drug trial. In that location were no known negative relationships in either experiments. Starting with XYZ, nosotros were able to encounter that the drug has a stastically significant outcome on the sample group; However, if we were to make up one's mind which drug was more effective, so it would be ABC. ABC drug was the but drug where nosotros were able to reject the nada, and accept the alternative hypothesis, and see a positive upshot on the participants. With XYZ, we accepted the null, and the alternative hypothesis. at that place just wasn't a significant difference between the means to reject the cypher hypothesis.
Since we used the same group, we were able to recieve consistent results. Nosotros saw a normal distribution with each sample. Our P-values signal that in cases where nosotros hypothesized that the last BP reading was less than the inital reading, we had a lower value; However, when we stated that the intial BP was in fact lower than the last BP for both drug trials, nosotros saw a higher p-value.
LS0tDQp0aXRsZTogIlQtdGVzdCINCmF1dGhvcjogIkphY2x5biBCYXpzaWthIg0KZm9udDogIkdlb3JnaWEiDQpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sNCi0tLQ0KIVtdKGh0dHA6Ly94d2h5LmNvbWljZ2VuZXNpcy5jb20vY29taWNzLzIwMTQwNjAzYmVsbGUtd2hpc2tlcnMwNS5wbmcpDQoNCiMjSG93IHRvIHJ1biBhIFQtdGVzdA0KDQpgYGB7cn0NCiNJbnN0YWxsIHRoZSAnZ2RhdGEnIHBhY2thZ2UuIFRoaXMgd2lsbCBhbGxvdyBSIFN0dWRpbyB0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HRoYXQgdGhlIGZpbmFsIEJQIHJlYWRpbmcgd2FzIGxlc3MgdGhhbiB0aGUgaW5pdGFsIHJlYWRpbmcsIHdlIGhhZCBhIGxvd2VyIHZhbHVlOyBIb3dldmVyLCB3aGVuIHdlIHN0YXRlZCB0aGF0IHRoZSBpbnRpYWwgQlAgd2FzIGluIGZhY3QgbG93ZXIgdGhhbiB0aGUgZmluYWwgQlAgZm9yIGJvdGggZHJ1ZyB0cmlhbHMsIHdlIHNhdyBhIGhpZ2hlciBwLXZhbHVlLiAgDQoNCg0KDQo=
Source: https://rstudio-pubs-static.s3.amazonaws.com/265768_fdacdeb17dd640a580da2d3307a7fa3d.html
0 Response to "How to Compare Before and After Blood Pressure Readings in Excel With a T Test"
Post a Comment