You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref="#differences-from-the-original-paper" id="toc-differences-from-the-original-paper" class="nav-link" data-scroll-target="#differences-from-the-original-paper">Differences from the Original Paper</a></li>
<p>This tutorial reproduces the key tables from the <ahref="https://jamanetwork.com/journals/jama/article-abstract/2526639">Flegal et al. (2016)</a> article. The analysis uses the same NHANES data and aims to replicate the unweighted sample size counts from Table 1 and the weighted logistic regression models from Table 3. We incorporate <ahref="https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx">NCHS/CDC reliability standards</a> to ensure estimates are statistically defensible.</p>
1368
+
<p>This tutorial reproduces the key tables from the <ahref="https://jamanetwork.com/journals/jama/article-abstract/2526639">Flegal et al. (2016)</a> article. The analysis uses the same NHANES data and aims to replicate the unweighted sample size counts from Table 1 and the weighted logistic regression models from Table 3. We incorporate <ahref="https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx">NCHS/CDC reliability standards</a> to ensure estimates are statistically defensible<spanclass="citation" data-cites="nhanes_reliability_estimates">(<ahref="#ref-nhanes_reliability_estimates" role="doc-biblioref">Disease Control and Prevention 2025</a>)</span>.</p>
1348
1369
</section><sectionid="setup-and-data-preparation" class="level2"><h2class="anchored" data-anchor-id="setup-and-data-preparation">Setup and Data Preparation</h2>
1349
1370
<p>This first section prepares the data for analysis. The key steps are:</p>
<p>This section reproduces the unweighted sample sizes shown in Flegal et al.’s Table 1. The code first generates separate summary tables for all participants, men, and women. It then performs several formatting steps to combine these into a single table.</p>
<p>The <code>svytable1</code> function creates a descriptive summary table—commonly referred to as a <strong>“Table 1”</strong>—from complex survey data. It is specifically designed to produce publication-ready results that align with <ahref="https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx">NCHS Data Presentation Standards for reliability</a>.</p>
1457
+
<p>The <code>svytable1</code> function creates a descriptive summary table—commonly referred to as a <strong>“Table 1”</strong>—from complex survey data<spanclass="citation" data-cites="svyTable1">(<ahref="#ref-svyTable1" role="doc-biblioref">Karim 2025</a>)</span>. It is specifically designed to produce publication-ready results that align with <ahref="https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx">NCHS Data Presentation Standards for reliability</a>.</p>
<p>When you call <code>svytable1</code> (<ahref="https://github.com/ehsanx/svyTable1">link</a>), it performs the following steps for each analysis (for example, for all participants, men, and women):</p>
<p><strong>The RSE Can Be Misleading for Regression</strong>: Notice that some statistically insignificant coefficients (like <code>Age40-59</code> and <code>raceHispanic</code>) have high RSEs, which is expected. However, the <code>education\>High school</code> coefficient is highly insignificant: p-value of 0.932 correctly tells you that this coefficient is not statistically significant and is not reliably different from zero. However its RSE is flagged as “TRUE” for being unreliable. The RSE is calculated as (0.147 / -0.013) * 100 = 1109%. Here, the extremely high RSE here is not a result of a large standard error, but of the coefficient estimate being very close to zero. An inflated RSE doesn’t provide any new or more accurate information than the p-value; it simply reflects that the coefficient itself is minuscule. This is a great example of why RSE isn’t a primary tool for regression coefficients: it can be inflated by estimates close to zero, regardless of their precision.</p>
2136
2157
</section><sectionid="check-for-multicollinearity" class="level3"><h3class="anchored" data-anchor-id="check-for-multicollinearity">Check for Multicollinearity</h3>
2137
2158
<p>Multicollinearity occurs when predictor variables in a model are highly correlated with each other. This can inflate the standard errors and make your coefficient estimates unstable. The VIF is used to detect this issue.</p>
2138
-
<p><code>GVIF^(1/(2*Df))</code> is a scaled version of the Generalized Variance Inflation Factor (GVIF) used to assess multicollinearity in regression models with categorical predictors. It adjusts for the number of dummy variables created for a categorical variable, making its value directly comparable to the traditional VIF used for continuous predictors within the same model.</p>
2159
+
<p><code>GVIF^(1/(2*Df))</code> is a scaled version of the Generalized Variance Inflation Factor (GVIF) used to assess multicollinearity in regression models with categorical predictors<spanclass="citation" data-cites="fox1992generalized">(<ahref="#ref-fox1992generalized" role="doc-biblioref">Fox and Monette 1992</a>)</span>. It adjusts for the number of dummy variables created for a categorical variable, making its value directly comparable to the traditional VIF used for continuous predictors within the same model.</p>
2139
2160
<sectionid="why-gvif12df-is-necessary-for-categorical-variables" class="level4"><h4class="anchored" data-anchor-id="why-gvif12df-is-necessary-for-categorical-variables">Why GVIF<sup>1/(2×Df)</sup> is Necessary for Categorical Variables</h4>
2140
2161
<p>A categorical variable with (k) levels (e.g., <em>race</em>) is typically represented in a regression model by (k - 1) <strong>dummy variables</strong>. Dummy variables are inherently correlated because they all describe the same categorical feature. This intrinsic relationship would lead to very high — but misleading — <strong>GVIF</strong> scores if the overall GVIF were interpreted directly.</p>
2141
2162
<p>The adjustment GVIF<sup>1/(2×Df)</sup> standardizes the GVIF value. It reduces the measure from a <em>hypervolume</em> of confidence for multiple coefficients down to a linear measure, making it comparable to the single VIF value used for continuous predictors. Here, <strong>Df</strong> is the degrees of freedom for the categorical term, which equals (k - 1), the number of dummy variables.</p>
<td>Potentially severe multicollinearity. The predictor may have a strong overlap with others, obscuring its effect on the outcome. A more conservative cutoff of <strong>4</strong> is sometimes used.</td>
2189
+
<td>Potentially severe multicollinearity. The predictor may have a strong overlap with others, obscuring its effect on the outcome.</td>
2169
2190
</tr>
2170
2191
</tbody>
2171
2192
</table>
2193
+
<p>A more conservative cutoff of *3** is sometimes used. The scaled GVIF, (GVIF^{1/(2·df)}), is designed to be comparable to the square root of the VIF, which explains the use of cutoffs like () (≈ 2.24) and () (≈ 3.16) <spanclass="citation" data-cites="nahhas2024introduction">(<ahref="#ref-nahhas2024introduction" role="doc-biblioref">Nahhas 2024</a>)</span>. Larger than () (≈ 4.47) is therefore the case of severe multicollinearity.</p>
2172
2194
<divclass="cell">
2173
2195
<divclass="sourceCode cell-code" id="cb10"><preclass="sourceCode numberSource r number-lines code-with-copy"><codeclass="sourceCode r"><spanid="cb10-1"><ahref="#cb10-1"></a>vif_values <spanclass="ot"><-</span><spanclass="fu">vif</span>(fit_men_obese)</span>
</section><sectionid="differences-from-the-original-paper" class="level3"><h3class="anchored" data-anchor-id="differences-from-the-original-paper">Differences from the Original Paper</h3>
2421
2443
<p>While the ‘Statistical Analyses’ section of Flegal et al. (2016) details their models, it does not explicitly state the method used to handle missing data for covariates. Our replication employs a complete-case analysis, which excludes participants with missing smoking or education data from the models. This difference is the most likely reason for the minor discrepancies between our results and those published in the original paper.</p>
Disease Control, Centers for, and Prevention. 2025. <span>“NHANES Tutorials: Reliability of Estimates Module.”</span> National Center for Health Statistics. <ahref="https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx">https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx</a>.
Fox, John, and Georges Monette. 1992. <span>“Generalized Collinearity Diagnostics.”</span><em>Journal of the American Statistical Association</em> 87 (417): 178–83.
Karim, Mohammad Ehsanul. 2025. <span>“svyTable1: Table 1 and Diagnostics from Complex Survey Designs.”</span><ahref="https://github.com/ehsanx/svyTable1">https://github.com/ehsanx/svyTable1</a>.
Copy file name to clipboardExpand all lines: surveydata9.qmd
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Introduction
4
4
5
-
This tutorial reproduces the key tables from the [Flegal et al. (2016)](https://jamanetwork.com/journals/jama/article-abstract/2526639) article. The analysis uses the same NHANES data and aims to replicate the unweighted sample size counts from Table 1 and the weighted logistic regression models from Table 3. We incorporate [NCHS/CDC reliability standards](https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx) to ensure estimates are statistically defensible.
5
+
This tutorial reproduces the key tables from the [Flegal et al. (2016)](https://jamanetwork.com/journals/jama/article-abstract/2526639) article. The analysis uses the same NHANES data and aims to replicate the unweighted sample size counts from Table 1 and the weighted logistic regression models from Table 3. We incorporate [NCHS/CDC reliability standards](https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx) to ensure estimates are statistically defensible[@nhanes_reliability_estimates].
@@ -97,7 +97,7 @@ This section reproduces the unweighted sample sizes shown in Flegal et al.'s Tab
97
97
98
98
### What `svytable1` Does
99
99
100
-
The `svytable1` function creates a descriptive summary table—commonly referred to as a **“Table 1”**—from complex survey data. It is specifically designed to produce publication-ready results that align with [NCHS Data Presentation Standards for reliability](https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx).
100
+
The `svytable1` function creates a descriptive summary table—commonly referred to as a **“Table 1”**—from complex survey data[@svyTable1]. It is specifically designed to produce publication-ready results that align with [NCHS Data Presentation Standards for reliability](https://wwwn.cdc.gov/nchs/nhanes/tutorials/reliabilityofestimates.aspx).
101
101
102
102
### Key `svytable1` Operations
103
103
@@ -305,7 +305,7 @@ The few significant predictors are `raceNon-Hispanic Asian` and `education\<High
305
305
306
306
Multicollinearity occurs when predictor variables in a model are highly correlated with each other. This can inflate the standard errors and make your coefficient estimates unstable. The VIF is used to detect this issue.
307
307
308
-
`GVIF^(1/(2*Df))` is a scaled version of the Generalized Variance Inflation Factor (GVIF) used to assess multicollinearity in regression models with categorical predictors. It adjusts for the number of dummy variables created for a categorical variable, making its value directly comparable to the traditional VIF used for continuous predictors within the same model.
308
+
`GVIF^(1/(2*Df))` is a scaled version of the Generalized Variance Inflation Factor (GVIF) used to assess multicollinearity in regression models with categorical predictors[@fox1992generalized]. It adjusts for the number of dummy variables created for a categorical variable, making its value directly comparable to the traditional VIF used for continuous predictors within the same model.
309
309
310
310
#### Why GVIF<sup>1/(2×Df)</sup> is Necessary for Categorical Variables
311
311
@@ -322,7 +322,9 @@ The interpretation of GVIF<sup>1/(2×Df)</sup> follows the same guidelines as th
322
322
|**1**| No correlation among predictors. |
323
323
|**1 – 2.5**| Low to moderate correlation — generally acceptable (typical for most well-specified models). |
324
324
|**2.5 – 5**| Moderate to high correlation — may warrant further investigation. |
325
-
|**\> 5**| Potentially severe multicollinearity. The predictor may have a strong overlap with others, obscuring its effect on the outcome. A more conservative cutoff of **4** is sometimes used. |
325
+
|**\> 5**| Potentially severe multicollinearity. The predictor may have a strong overlap with others, obscuring its effect on the outcome. |
326
+
327
+
A more conservative cutoff of *3** is sometimes used. The scaled GVIF, \(GVIF^{1/(2·df)}\), is designed to be comparable to the square root of the VIF, which explains the use of cutoffs like \(\sqrt{5}\) (≈ 2.24) and \(\sqrt{10}\) (≈ 3.16) [@nahhas2024introduction]. Larger than \(\sqrt{20}\) (≈ 4.47) is therefore the case of severe multicollinearity.
While the 'Statistical Analyses' section of Flegal et al. (2016) details their models, it does not explicitly state the method used to handle missing data for covariates. Our replication employs a complete-case analysis, which excludes participants with missing smoking or education data from the models. This difference is the most likely reason for the minor discrepancies between our results and those published in the original paper.
0 commit comments