When we are finding the test statistic, we need to find Sp^2. I understand this is found with the equation ((n1-1)*S1^2 + (n2-1)*S2^2)/(n1+n2-2). But, how do we find S1^2 and S2^2? Is it found using the equation for S from a single variable case and squaring it and doing this for both cases?
Problem 1 is about the inferences for "the difference of two population proportions".
Please take a look at the Day18 note on the web.
Our test statistic would be based on the two sample proportions.
Your comments are more relevant and helpful for the problem 2 and 3.
If we want to make inferences for "the difference of two population means",
then we need to calculate the both S1^2 and S2^2.
Those are just the sample variances,
so we can use "var()" command in R-Studio.
In addition, if we can assume the two variances are equivalent,
then Sp^2 needs to be calculated by the formula you provided.