Skip to content

ENH: GLM - DOE, power, effect size, noncentrality, sample size #6759

Open

Description

@josef-pkt

(just some thoughts)

continuation of
#6558 noncentrality and power for OLS
My current version uses cov_params and applies to generic wald test in models

The wald test is defined in terms of linear/affine restrictions on parameters.

  • For design of prototype dataset, we might want to start with expected proportions under null and alternative for different exog.
    Example, in oneway or two-way anova, we might want to specify cell means and then compute implied parameters and restriction on those using the link function. We need a helper function for that.

  • Noncentrality and power will be defined for chisquare/F or normal/t distribution, i.e. effect size is not directly defined in terms of risk difference, risk ratio or odds ratio. (similar to Cohen's fsqu versus Cohen's standardized mean diff delta). This should be analogous generalization to joint hypothesis test compared to a single parameter restriction in two sample case.

  • Variance as a function of mean. I guess a similar issue will show up as in power for a single proportion. The variance differs between null parameters and alternative parameters.
    The simpler starting point will be local or Wald analysis where we assume variance and weights for irls/cov_params remain unchanged, similar to effectsize power for one proportion.
    I didn't think yet about how we can handle the case with different cov_params under null and alternative, that wouldn't be local wald or score test anymore.

update after skimming some of the literature (mainly GLM, logit)

3 main approaches, AFAICS

  • exemplary dataset: create dataset that reflects distribution of (endog, exog) under the alternative
    • if we have freq_weights available, then we need only unique (y, x) combinations, possibly discretized
    • methods to approximate variance, noncentrality under null and alternative
  • use simple regression (constant plus exog of interest) and use variance inflation factor to correct for other exog.
    • explicit formulas are available for some endog and exog types, e.g. two independent samples - one binary regressor.
    • can we just vif inflate the current 2 independent sample power functions?
  • simulation: I did not look at literature, but we run Monte Carlo simulations quite often. Also need fully specified sampling distribution

some references, but I have not looked enough to decide which methods to implement.
(many stats articles are too "hand-wavy", not enough details and justification for what they are doing)
(list is incomplete)

Bush, Stephen. 2015. “Sample Size Determination for Logistic Regression: A Simulation Study.” Communications in Statistics - Simulation and Computation 44 (2): 360–73. https://doi.org/10.1080/03610918.2013.777458.

Faul, Franz, Edgar Erdfelder, Axel Buchner, and Albert-Georg Lang. 2009. “Statistical Power Analyses Using G*Power 3.1: Tests for Correlation and Regression Analyses.” Behavior Research Methods 41 (4): 1149–60. https://doi.org/10.3758/BRM.41.4.1149.

Hsieh, F. Y., Daniel A. Bloch, and Michael D. Larsen. 1998. “A Simple Method of Sample Size Calculation for Linear and Logistic Regression.” Statistics in Medicine 17 (14): 1623–34. https://doi.org/10.1002/(SICI)1097-0258(19980730)17:14<1623::AID-SIM871>3.0.CO;2-S.

Hsieh, F. Y., Philip W. Lavori, Harvey J. Cohen, and John R. Feussner. 2003. “An Overview of Variance Inflation Factors for Sample-Size Calculation.” Evaluation & the Health Professions 26 (3): 239–57. https://doi.org/10.1177/0163278703255230.

Lyles, Robert H., Hung-Mo Lin, and John M. Williamson. 2007. “A Practical Approach to Computing Power for Generalized Linear Models with Nominal, Count, or Ordinal Responses.” Statistics in Medicine 26 (7): 1632–48. https://doi.org/10.1002/sim.2617.

Martens, Michael J., Soyoung Kim, and Kwang Woo Ahn. 2023. “Sample Size and Power Determination for Multiparameter Evaluation in Nonlinear Regression Models with Potential Stratification.” Biometrics 79 (4): 3916–28. https://doi.org/10.1111/biom.13897.

Martens, Michael J., and Brent R. Logan. 2021. “A Unified Approach to Sample Size and Power Determination for Testing Parameters in Generalized Linear and Time-to-Event Regression Models.” Statistics in Medicine 40 (5): 1121–32. https://doi.org/10.1002/sim.8823.

Self, Steven G., and Robert H. Mauritsen. 1988. “Power/Sample Size Calculations for Generalized Linear Models.” Biometrics 44 (1): 79–86. https://doi.org/10.2307/2531897.

Shieh, Gwowen. 2005. “On Power and Sample Size Calculations for Wald Tests in Generalized Linear Models.” Journal of Statistical Planning and Inference 128 (1): 43–59. https://doi.org/10.1016/j.jspi.2003.09.017.

Tang, Yongqiang, Liang Zhu, and Jiezhun Gu. 2021. “An Improved Sample Size Calculation Method for Score Tests in Generalized Linear Models.” Statistics in Biopharmaceutical Research 13 (4): 415–24. https://doi.org/10.1080/19466315.2020.1756398.

Zhu, Haiyuan. 2017. “Sample Size Calculation for Comparing Two Poisson or Negative Binomial Rates in Noninferiority or Equivalence Trials.” Statistics in Biopharmaceutical Research 9 (1): 107–15. https://doi.org/10.1080/19466315.2016.1225594.

Activity

  1. josef-pkt commented on May 29, 2020

    @josef-pkt
    MemberAuthor

    GLM gaussian instead of OLS/WLS:

    GLM has freq_weights, so it might be easier to define a prototype sample. e.g. O’Brien, R. G., and K. E. Muller. 1993 (and Stata in following that reference) use freq_weights for prototype.

    freq_weights are mainly a convenience and allow fractional observations. The total sample size in the prototype dataset is irrelevant for noncentrality because we standardized by nobs.

  2. josef-pkt commented on May 29, 2020

    @josef-pkt
    MemberAuthor

    package lmSupport has a power function for generic f-test/anova_lm effect sizes
    https://www.rdocumentation.org/packages/lmSupport/versions/2.9.13/topics/modelPower
    it delegates to pwr pwr.f2.test
    https://www.rdocumentation.org/packages/pwr/versions/1.3-0/topics/pwr.f2.test
    which is similar to my FTestPower (also uses df_num, df_denom as arguments instead of nobs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions