1
$\begingroup$

I have 2 datasets. Dataset X looks like this:

Jmp_o   Nws_r
1       0
0       1
1       1
0       1
0       1
1       0
1       0
...    ...

I calculate the conditional probability P(jmp_o=1|nws_r=1). There is another dataset Y which is like:

Jmp_o   Nws_r
1       0
0       0
1       0
0       0
0       0
1       0
1       0
...    ...

From dataset Y I calculate unconditional probability P(jmp_o=1).

I want to test whether these 2 probabilities are statistically different (by means of p-value).

What test should I perform?

Further clarification: first I have dataset X from where I calculate the conditional probability. Then from dataset X I create a subsample which has Nws_r=0. After creating dataset Y, I calculate the unconditional probability. Now I need to check whether they are different.

$\endgroup$
  • $\begingroup$ I don't know why the datasets look like that! I'm posting an excel sheet. $\endgroup$ – Deepan Das Sep 6 at 9:26
3
$\begingroup$

If data can be assumed all independent, you can use a standard test to compare two proportions (prop.test in R with references on its help page), where in the first sample you only use the observations for which nws_r=1.

$\endgroup$
  • $\begingroup$ Would you please tell what test it would be for SAS? and any help on the code? $\endgroup$ – Deepan Das Sep 6 at 16:17
  • $\begingroup$ To further clarify, first I have dataset X from where I calculate the conditional probability. Then from dataset X I create a subsample which has Nws_r=0. After creating dataset Y, I calculate the unconditional probability. Now I need to check whether they are different. $\endgroup$ – Deepan Das Sep 6 at 17:05
  • $\begingroup$ For help with SAS code please see stats.meta.stackexchange.com/questions/793/…. $\endgroup$ – whuber Sep 6 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.