### PROPORTIONS TEST FOR TWO INDEPENDENT SAMPLES WHEN NULL HUYPOTHESIS PROBABILITIES ### ARE COMPLETELY SPECIFIED ### DESCRIPTION: ### Tests 2 samples against specified population parameters ### Ex: Ho: P(1) = .0002, P(2) = .0006 ### REQUIRED ARGUMENTS: ### x = vector of 2 elements containing the number of successes for each sample. ### n = vector of 2 elements containing the total number of trials for each sample. ### p = vector of 2 elements containing the probabilities of success to be ### tested in the null hypothesis. ### NOTE: elements in x, n, and p must all correspond with one another. ### conf.level = desired confidence level ### alternative = "two.sided", "greater", "less" ### ### correct = logical flag: if TRUE, Yates' continuity correction will be applied, ### but only under certain conditions. When there is only one group, the continuity ### correction may not exceed in magnitude the difference between the sample ### proportion x/n and the hypothesized true probability of success. When there are ### two groups, and p is NULL, then the continuity correction may not exceed in ### magnitude the difference between the sample proportions. When there are more than ### two groups, the continuity correction is never used. x <- c(57,142) n <- c(200745,201229) p <- c(.0002,.0006) alternative <- "two.sided" conf.level <- .95 prop.test(x,n,p=p,alternative=alternative,conf.level=conf.level,correct=T)