Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##ch 9 prob 9
- ch9_prob3_data <- read.csv("C:/Users/benny/Downloads/ch9_prob3_data.csv")
- data=ch9_prob3_data
- install.packages("BSDA") #this took obscenely long to install and i think it's bc i didnt put BDSA in quotations
- library(BSDA)
- SIGN.test(data$post,data$pre,alternative="greater")
- ## OUTPUT:
- # Dependent-samples Sign-Test
- # data: data$post and data$pre
- # S = 20, p-value = 0.002039
- # alternative hypothesis: true median difference is greater than 0
- # 95 percent confidence interval:
- # 2 Inf
- # sample estimates:
- # median of x-y
- # 3
- #Achieved and Interpolated Confidence Intervals:
- # Conf.Level L.E.pt U.E.pt
- # Lower Achieved CI 0.8998 2 Inf
- # Interpolated CI 0.9500 2 Inf
- # Upper Achieved CI 0.9506 2 Inf
- ##### questions ####
- # a. the paired t-test alt hypo focuses on the true mean and it be not equal to 0, while the sign test's A.H. is the true median #difference being greater than 0
- # b. the probability (p=0.002039) of the difference of the mean being greater than 0
- # c. the data suggest that it is likely that the ginkgo supplement improved memory
- # d. determining which test to use depends on what assumptions are true for the data, which would make a certain test stronger
- # e. the non-parametric sign test is weaker than the parametric paired t-test because the Normality assumption has been violated
- ### problem 10 ###
- ch9_prob5_data <- read.csv("C:/Users/benny/Downloads/ch9_prob5_data.csv")
- data5=ch9_prob5_data
- wilcox.test(data5$treatment,data$pre,conf.int = TRUE,exact = FALSE)
- ## OUTPUT ##
- # Wilcoxon rank sum test with continuity correction
- # data: data5$treatment and data$pre
- # W = 531.5, p-value = 0.2305
- # alternative hypothesis: true location shift is not equal to 0
- # 95 percent confidence interval:
- # -1.999932 8.000014
- # sample estimates:
- # difference in location
- # 3.000008
- ### questions ###
- # a. the p-value (0.2305) lands in the grey zone of p-val. significance, so it suggests that the ginkgo supplements may somewhat #improve memory test scores
- # b. 8.000014 - 3.000008 = 5.000006(+-)3
- # c. the data suggest that ginkgo supplements may improve memory test scores by 5(+-)3 points, but more research is needed
- # d. the M-W U-test functions off the Normality assumption being violated, while the 2-sample test assumes Normality
Advertisement
Add Comment
Please, Sign In to add comment