What would be the code using the package wperm from RStudios for an example like this? A
Question:
What would be the code using the package "wperm" from RStudios for an example like this?
A quality control engineer collects a sample of gears, examining 1000 gears from each of two companies: the current supplier, and a competitor. The competitor is more expensive, but claims their gears are more reliable, lowering warranty claims. At a 91 percentage level, evaluate the difference in quality control: is there a statistical increase in reliability for the competitor versus the current supplier?Results of Experiment
Current Competitor
Pass 850 957
Fail 150 43
Use set.seed(120) for the randomization, and the wPerm package to explore the difference in proportions, proportion passing QC (competitor) minus proportion passing QC (current supplier). Use R = 1e4 replicates, and a data vector in 'stacked' form using the code:
dat <- data.frame(QCPass = c(rep(1, 850), rep(0, 150), rep(1, 957), rep(0, 43)), Company = factor(c(rep(1, 1000), rep(2, 1000))))
For the hypothesis test of competitor greater than current, as reported by wPerm:
The observed difference:
The empirical p-value: