Can I use a z test to compare two samples if there is a significant difference in the size? I have to compare two unequal size samples from a population of 53k. One has a proportion of 56% and size of 50k and the other has a proportion of 50% and size of 3k. Can I do a two proportion z test to compare to make a case that the proportion of sample 1 is greater than sample 2?
Does the difference in the sample size pose an issue?
Some more info:
Here is the situation: Lets say I had 53k people and 50k received treatment A and 3k received treatment B. From the 3k, 50% showed positive results and from the 50k, 56% showed positive effect. How can I conclude that my treatment A was more effective than treatment B? I am looking for a way to make that case.
 A: Yes. In R, the procedure prop.test uses sizes of the two
samples (which may differ) and counts of 'successes' in
the two samples.
Then the test is as shown below:
The very small P-value indicates a highly significant
difference between the proportions $\hat p_1 =0.56$ and
$\hat p_2 =   0.50.$ [Because of the large sample sizes
I have not used the continuity correction cor=F.]
p1 = .56; n1 = 50000; x1 = round(p1*n1)
p2 = .50; n2 = 3000;  x2 = round(p2*n2)
prop.test(c(x1,x2), c(n1,n2), cor=F)


    2-sample test for equality of proportions 
    without continuity correction

data:  c(x1, x2) out of c(n1, n2)
X-squared = 41.284, df = 1, p-value = 1.317e-10
alternative hypothesis: two.sided
95 percent confidence interval:
 0.04158663 0.07841337
sample estimates:
 prop 1 prop 2 
   0.56   0.50 

Notes: (1) The X-squared statistic shown in the
output is the square of the normal $Z$-statistic.
(2) The version of the test used here is the one in the (yellow) note at the end of
this page
so that the confidence interval 'matches' the test. [If the 95% CI does not include $0,$ then the two proportions are significantly different
at the 5% level.]
A: The R method provided above is correct for this specific case.
The statistics is a Z statistics, but you have to be careful on how you calculate.
You can find a formula in https://en.wikipedia.org/wiki/Test_statistic, and searching for 'Two-proportion z-test'. The page also provides when you can use Z statistics.
The above web page provides formulas for many statistical tests: so you can use for other analyses.
