Assignment-#9

docx

School

RMU *

*We aren’t endorsed by this school

Course

4265

Subject

Statistics

Date

Feb 20, 2024

Type

docx

Pages

7

Uploaded by EarlFlamingoMaster919

Report
MARK4265 Assignment #9 Instructor: Yanbin Tu Student Name: Jeremiah Brosovic This is an individual work! This is an individual assignment. Please download the dataset (Assignment9Data.xlsx) and do the following work: 1.Please use the worksheet “OnlineAuction1”, and create a CSV file or text file. Then, save it under one folder. The dataset lists the auction success rate for Item A (Column: SuccessRate-A), and for Item B (Column: SuccessRate-B) at eBay. You wonder if Item A’s mean value is equal to 0.70. Please use R for one sample t-test. Please briefly interpret the testing result. > OnlineAuction1 <- read.csv(file="c:/MARK4265/OnlineAuction1.csv") > head(OnlineAuction1) Day SuccessRate.A SuccessRate.B 1 1 0.7895 0.5789 2 2 0.8800 0.8800 3 3 0.8182 0.7273 4 4 0.6818 0.6364 5 5 0.6957 0.6957 6 6 0.7959 0.6531 > t.test(OnlineAuction1$SuccessRate.A,mu=70) One Sample t-test data: OnlineAuction1$SuccessRate.A t = -6532.1, df = 39, p-value < 2.2e-16 alternative hypothesis: true mean is not equal to 70 95 percent confidence interval: 1
0.6968091 0.7397159 sample estimates: mean of x 0.7182625 > t.test(OnlineAuction1$SuccessRate.B,mu=70) One Sample t-test data: OnlineAuction1$SuccessRate.B t = -5549.8, df = 39, p-value < 2.2e-16 alternative hypothesis: true mean is not equal to 70 95 percent confidence interval: 0.6477981 0.6983319 sample estimates: mean of x 0.673065 From the test shown above, we see that the estimated mean for item A is found to be equal to .718. In addition, with a p-value equal to basically 0, we see that the mean is not equal to .70. 2.Please use the worksheet “OnlineAuction2”, and create a CSV file or text file. Then, save it under one folder. The dataset lists the auction success rate for Item A and for Item B at eBay. You wonder if both rates are equal. Please use R for an independent sample mean comparison t-test. Please briefly interpret the testing result. > OnlineAuction2 <- read.csv(file="c:/MARK4265/OnlineAuction2.csv") > head(OnlineAuction2) X. SuccessRate_A SuccessRate_B 1 1 0.7895 0.6881 2 2 0.8800 0.5789 2
3 3 0.8182 0.8800 4 4 0.6818 0.7273 5 5 0.6957 0.6364 6 6 0.7959 0.6957 > t.test(OnlineAuction2$SuccessRate_A, OnlineAuction2$SuccessRate_B) Welch Two Sample t-test data: OnlineAuction2$SuccessRate_A and OnlineAuction2$SuccessRate_B t = 2.7943, df = 77.374, p-value = 0.006554 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.01310884 0.07809954 sample estimates: mean of x mean of y 0.7190359 0.6734317 From the test result shown above, we see that item A has a mean of .719 whereas item B has a mean of .673. Therefore, the mean values are not equal to each other. 3.Please use the worksheet “NewDrug” this week, and create a CSV file or text file… Suppose Dr. Smith wonder if the new drug is effective or not. If the blood pressure before the experiment (Before_exp_BP) is equal to the blood pressure after the experiment (After_exp_BP), the new drug should be ineffective. If the blood pressure before the experiment (Before_exp_BP) is higher than the blood pressure after the experiment (After_exp_BP), the new drug is effective. Please help Dr. Smith to explore the answer. Please use R for a paired sample mean comparison t-test. Please briefly interpret the testing result. > NewDrug <- read.csv(file="c:/MARK4265/NewDrug.csv") > head(NewDrug) Subject Treatment Age Gender Before_exp_BP After_exp_BP 1 D1 1 65 F 103.3 80.5 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
2 D2 1 59 F 93.6 85.9 3 D3 1 60 M 92.0 85.2 4 D4 1 54 F 93.0 87.8 5 D5 1 65 F 95.4 85.3 6 D6 1 57 M 109.6 94.2 > t.test(NewDrug$Before_exp_BP, NewDrug$After_exp_BP, paired = TRUE) Paired t-test data: NewDrug$Before_exp_BP and NewDrug$After_exp_BP t = 11.07, df = 49, p-value = 6.195e-15 alternative hypothesis: true mean difference is not equal to 0 95 percent confidence interval: 7.942382 11.465618 sample estimates: mean difference 9.704 From the test results shown above, we can see that there is an estimated mean difference of 9.704. This means that the new drug is effective as there is a noticeable difference in the blood pressure levels before and after the experiment. 4. One chocolate store has three brands available to its customers. The worksheet “Chocolate” records the data of two customers’ brand choices. The store owner Jack wants to know if brand choices show no difference between the two customers. Please use R to build a Crosstable and apply a chi-square test. Please briefly interpret the testing result. > Chocolate <- read.csv(file="c:/MARK4265/Chocolate.csv") > head(Chocolate) X. Customer Chocolate 1 1 Alice SAMA 2 8 Alice SAMA 4
3 11 Alice SAMA 4 13 Alice SAMA 5 15 Alice SAMA 6 17 Alice SAMA > library(gmodels) > CrossTable(Chocolate$Customer, Chocolate$Chocolate, chisq = TRUE) Cell Contents |-------------------------| | N | | Chi-square contribution | | N / Row Total | | N / Col Total | | N / Table Total | |-------------------------| Total Observations in Table: 90 | Chocolate$Chocolate Chocolate$Customer | SAMA | SOMO | SUMU | Row Total | -------------------|-----------|-----------|-----------|-----------| Alice | 14 | 16 | 15 | 45 | | 0.250 | 0.015 | 0.500 | | | 0.311 | 0.356 | 0.333 | 0.500 | 5
| 0.438 | 0.485 | 0.600 | | | 0.156 | 0.178 | 0.167 | | -------------------|-----------|-----------|-----------|-----------| Mary | 18 | 17 | 10 | 45 | | 0.250 | 0.015 | 0.500 | | | 0.400 | 0.378 | 0.222 | 0.500 | | 0.562 | 0.515 | 0.400 | | | 0.200 | 0.189 | 0.111 | | -------------------|-----------|-----------|-----------|-----------| Column Total | 32 | 33 | 25 | 90 | | 0.356 | 0.367 | 0.278 | | -------------------|-----------|-----------|-----------|-----------| Statistics for All Table Factors Pearson's Chi-squared test ------------------------------------------------------------ Chi^2 = 1.530303 d.f. = 2 p = 0.4652634 From the test results above we see that the p-value = .465 is much greater than the significant value of .05. Therefore, we can conclude that there is no significant difference between the two customers and brand choices. 5.Please use the worksheet “StartupCost”. This dataset shows you the startup costs for various stores. One of your best friends, Ashly states that the average startup costs for any type of businesses are the same. Please use R for one-way ANOVA test. Please briefly interpret the testing result. Is Ashly’s statement true or false? > StartupCosts <-read.csv(file="c:/MARK4265/StartupCosts.csv") > head(StartupCosts) 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
store cost 1 pizza\xa0 80 2 pizza\xa0 125 3 pizza\xa0 35 4 pizza\xa0 58 5 pizza\xa0 110 6 pizza\xa0 140 > StartupCosts = aov(cost~store, data=StartupCosts) > summary(StartupCosts) Df Sum Sq Mean Sq F value Pr(>F) store 4 11560 2890 2.511 0.0521 . Residuals 55 63299 1151 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 After the test we receive a p-value of .0521. Though is it almost at the level of significance at .05 it is greater, therefore, we reject the null hypothesis and can conclude that startup costs for any type of business is not the same. 7