Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMHTest type="cor" supresses p-value and df #2

Open
bill-raynor opened this issue Jun 11, 2018 · 4 comments
Open

CMHTest type="cor" supresses p-value and df #2

bill-raynor opened this issue Jun 11, 2018 · 4 comments

Comments

@bill-raynor
Copy link

When I run CMHtest(as.formula(fStr), data=dm, types = c("cor"), overall = T) the $ALL element lacks a p-value and a d.f. Any particular reason why?

Example:
CMHtest(Freq~right+left|gender, data=VisualAcuity, overall=T, type="cor", details=T) lacks a p-value but CMHtest(Freq~right+left|gender, data=VisualAcuity, overall=T, type="cor", details=T) doesn't.

@friendly
Copy link
Owner

friendly commented Jun 11, 2018

Your two examples are identical, as far as I can see.

Pedantic: you should use types="cor" not type="cor" or types=c("cor"), and =TRUE, not =T.

If you omit the types=arg, the function does give the df`` and Prob` column in the result. I don't have an immediate explanation for this.

@bill-raynor
Copy link
Author

That's primarily because I didn't proof the post carefully. My apologies.
The types= version CMHtest(Freq~right+left|gender, data=VisualAcuity, types=c("cor"), overall=TRUE) produces

    ....
    $ALL
     Cochran-Mantel-Haenszel Statistics for right by left 
	  Overall tests, controlling for all strata 

             AltHypothesis  Chisq Df Prob
    cor Nonzero correlation 5193.2 NA   NA

while the call CMHtest(Freq~right+left|gender, data=VisualAcuity, overall=TRUE) produces

    ...
       $ALL
        Cochran-Mantel-Haenszel Statistics for right by left 
    	    Overall tests, controlling for all strata 

                    AltHypothesis  Chisq Df Prob
    cor        Nonzero correlation 5193.2  1    0
    rmeans  Row mean scores differ 5213.4  3    0
    cmeans  Col mean scores differ 5219.4  3    0
    general    General association  11316  9    0

WRT the types and T, point taken. I thought R permitted partial matches.

@lf-araujo
Copy link

Hi @bill-raynor,

I am facing a similar output in a recent analysis. So in your second output just above, Does Prob 0 effectively means that comparison is statistically significant?

I am just finding the output a bit distinct from other R packages, where I see something like P < 0.05, for example.

Thank you

@bill-raynor
Copy link
Author

bill-raynor commented Jun 14, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants