Question: What would the code be using the package wperm on RStudios for a question like: In 2009, as the Affordable Care Act was creeping through
What would the code be using the package "wperm" on RStudios for a question like:
In 2009, as the Affordable Care Act was creeping through Congress in the United States, a public opinion poll was done, asking participants whether they supported a "public option" (effectively, socialized healthcare such as is offered in Canada or the United Kingdom). At an 93 percentage level, evaluate the difference between respondents who identify as Democrat versus respondents who identify as Republican: is there a statistical difference in the proportion of support?
Democrat Republican
Support 747 73
Oppose 365 653
Use set.seed(122) for the randomization, R = 5e4 replicates, and create a data vector in 'stacked' form using the code:
dat <- data.frame(Support = c(rep(1, 747), rep(0, 365), rep(1, 73), rep(0, 653)), Party = factor(c(rep("DEM", 747+365), rep("GOP", 73+653))))
For the hypothesis test of a statistical difference in proportions, as reported by wPerm:
The observed difference:
The empirical p-value:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
