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

[#186653738] Enhanced Degrees of Freedom Calculation with Squared Weighted Counts #392

Merged

Conversation

slobodan-ilic
Copy link
Contributor

This PR introduces an important fix in the calculation of the degrees of freedom (DoF) for pairwise comparisons in statistical analyses. The update is specifically targeted at scenarios where the "squared weighted counts" (SWC) cube measure is available.

Key Changes:

  • Utilization of SWC Measure: When the SWC measure is present, it is now employed to calculate the effective columns' bases. This approach refines the estimation of DoF by incorporating the weighted characteristics of the dataset.
  • DoF Calculation Logic: The degrees of freedom are now determined based on the type of column bases available. If effective column bases (derived from SWC) are available, they are used in the DoF calculation. This method provides a more accurate representation of the sample size, especially in weighted survey data.
  • Fallback to Unweighted Counts: In cases where the SWC measure is absent, the system reverts to using the standard unweighted counts for DoF calculations. This ensures compatibility and correctness in datasets where weighted measures are not applicable or available.

Implications:

  • This change is expected to enhance the accuracy of statistical tests and confidence intervals in weighted survey analyses, providing a more nuanced understanding of the underlying data.
  • The update maintains backward compatibility, ensuring that analyses without the SWC measure remain unaffected.

This enhancement aligns with our commitment to delivering precise and reliable statistical analysis tools. By incorporating the SWC measure into our DoF calculations, we are able to provide more nuanced insights, especially in complex, weighted datasets.

* The test is introduced to exercise the execution path that hits the
  pairwise degrees of freedom calculation, in the case of the presence
  of the "squared weighted counts" cube measure.
* The test will prevent regression to the standart unweighted counts, if
  the suqred ones are available.
* If available use effective counts for DOF in pairwise comparison
* Improve docstring for how bases are calculated
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (07cb337) 100.00% compared to head (9141ed9) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #392   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines         4620      4619    -1     
=========================================
- Hits          4620      4619    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@slobodan-ilic slobodan-ilic merged commit ee39d56 into master Dec 11, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants