-
Notifications
You must be signed in to change notification settings - Fork 26
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
significance testing results different than SPSS #32
Comments
Quantipy should most certainly work with Likert scale-type variables. The significance code has been tested quite a bit using Unicom/Dimensions and the default code replicates the Dimensions settings. The parameters can be tweaked quite a bit which can affect the results - could you share the exact parameters you use when you run the sig-diff in SPSS? |
Thanks for responding so quickly! Someone else actually created the references in SPSS as I am not very familiar with SPSS myself, what parameters would they be looking for? |
I'm not familiar with sig-diff testing in SPSS. All I can do is get the chi-square results in the Analyze>Crosstabs menu and that doesn't test each category, it just tests the overall number (I think). I've added an SPSS file to make testing/comparison easier with SPSS: tests/Example Data (A).sav This is the exact same data we use to test Quantipy. Ask your colleague to recreate what they are seeing with that file and post here so maybe we can figure out what parameters SPSS uses for their tests and then maybe we can see if the SPSS results are replicated with Quantipy. |
Thanks for the very detailed report. I don't think this has anything to do with the recode itself, but the Bonferroni correction, which isn't implemented in Quantipy. If I run your SPSS script without the Bonferroni correction, the result matches Quantipy.
I didn't write the sig-testing code myself, but I imagine the Bonferroni correction would happen somewhere here: and could be done with statsmodels I'll probably close this ticket for now but create a new one called "implement bonferroni corrections in sig-tests" or something like that. |
Great, that sounds great! thank you so much for pointing me to the engine.py doc |
|
|
Thanks for that. I can see now that there is a bug in the crosstab method when styling the output that makes tests with alpha < 0.01 not show up in the results. The result doesn't look as nice, but you can use the following to get the sig-test results
|
Fantastic, thank you for your help! Should I open up a new issue for this bug? |
Yes please, that would be great! |
hi @geirfreysson, sorry to bother again, but is there a book or reference I can check out for the methodologies behind the sig test? Or at least a name of the methodology? Also, is there a way I can specify that I want to perform a chi sq test instead of the default t test? Thank you! |
Hi @tc423, no bother at all. The default sig-tests mimic SPSS, Dimensions and Askia and are pairwise comparisons like the SPSS command COMPARETEST. ChiSquare tests are also available, but I don't have any code examples at hand. The SPSS documentation is here: COMPARETEST. You should be able to use the "sandbox" in Quantipy to do a chi square test, there is a method there calld chi_sq (here). |
I see, and does the sig-test take into consideration if the question is a
multiple response? I know that there is data processing for data type ==
delimited sets, but I'm wondering if it currently affects the sig-test
logic?
…On Fri, Apr 23, 2021 at 5:21 PM Geir Freysson ***@***.***> wrote:
Hi @tc423 <https://github.com/tc423>, no bother at all. The default
sig-tests mimic SPSS, Dimensions and Askia and are pairwise comparisons
like the SPSS command COMPARETEST. ChiSquare tests are also available, but
I don't have any code examples at hand.
The SPSS documentation is here: COMPARETEST
<https://www.ibm.com/docs/en/spss-statistics/24.0.0?topic=stcc-pairwise-comparisons-proportions-means-comparetest-subcommand-ctables-command>
.
You should be able to use the "sandbox" in Quantipy to do a chi square
test, there is a method there calld chi_sq (here
<https://github.com/Quantipy/quantipy3/blob/8a9cc67d10d08e279143333afddb18b6e789be85/quantipy/sandbox/sandbox.py#L6389>
).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDDLR4AVUYAKELXW63UHD3TKE32XANCNFSM4ZSQOVEA>
.
|
I see that there's a weight engine, and I assume this is to help adjust the data overlap issue in delimited sets data type, and gives the weight of each individual response? On a somewhat related note, is there a way I can see the p-values between each group? |
Hope that helps! |
I see, I also just realized that all of this was commented in the engine.py file that I am now trying to edit, so my apologies. Looks like we're back to the problem of not wanting to compare A to B if B is zero, I tried tweaking the source code but it doesn't seem to be working:
The only difference is that I added an if... else... statement when calculating p1-p2, but now when I run crosstab() with sig_level=0.05 it simply does not show any sig. I don't think it's a math error because plenty of my data has a count of 0, hence a difference of zero and there was never a problem. |
I'm glad you're making progress with this! If you manage to make it work you can add tests for it and a pull request and the additions will then be available to everyone. I would try and see if your code is working first with the code I mentioned in a previous comment in this thread. The crosstab method itself uses the "paint" mechanism that is used to make results pretty, so there are a few more steps where things can go wrong if you use |
In comparing results from SPSS and Quantipy, we discovered that using the dataset.crosstab() function gives different significance results for comparing categorical distribution than SPSS. I see in the sandbox.py document that chisq is used for calculating significance, which should give us the same results. Could this be because Quantipy does not recognize multivariates that are ordinal (Likert scale)?
The text was updated successfully, but these errors were encountered: