title: How to run regTermTest on every coefficient in a regression model in R?
body: <p>I want to run a Wald test to evaluate the statistical significance of each coefficient in the model using the <code>regTermTest</code> function of the <code>survey</code> package (as described <a href="https://mathewanalytics.com/2015/09/02/logistic-regression-in-r-part-two/" rel="nofollow noreferrer">here</a>). </p>
  
  <p>The syntax of <code>regTermTest</code> calls for the <code>model</code> followed by the <code>test.terms</code>, but if you list multiple test terms it seems to evaluate them all together rather than separately. </p>
  
  <pre><code>library(caret) # for the GermanCredit sample dataset
  data(GermanCredit)
  mod1 &lt;- glm(Class ~ Age + as.factor(ForeignWorker) + Property.RealEstate + Housing.Own + CreditHistory.Critical, data = GermanCredit, family = binomial(link='logit'))
  library(survey)
  regTermTest(mod1, c("Age", "ForeignWorker", "Property.RealEstate", "Housing.Own", "CreditHistory.Critical"))
  #
  </code></pre>
  
  <p>Of course, I could separate them out this way, but it's clunky and repetitive (i.e. the following code produces the desired result but is inefficient when dealing with lots of variables): </p>
  
  <pre><code>regTermTest(mod1, "Age")
  regTermTest(mod1, "ForeignWorker")
  regTermTest(mod1, "Property.RealEstate")
  regTermTest(mod1, "Housing.Own")
  regTermTest(mod1, "CreditHistory.Critical")
  </code></pre>
  
  <p>I've tried extracting the coefficient names into a vector and inserting it into a <code>for</code> loop, but it didn't work (it combines all the terms into one evaluation rather than separately estimating their importance):</p>
  
  <pre><code>vars &lt;- names(mod1$coefficients)
  vars &lt;- vars[-1]
  for (i in 1:length(vars)) {
       iv = vars[i]
       rtest &lt;- regTermTest(mod1, iv)
  }
  </code></pre>
  
  <p>How can I efficiently code this? </p>