title: Waldtest in R to get adjust F statistic with plm and result shown with stargazer?
body: <p>I am working with an unbalanced short panel. 
  Raw data: <a href="https://www.dropbox.com/s/yf1cd4nsn15yr8p/bankFull.xlsx?dl=0" rel="nofollow">bankFull.xlsx</a></p>
  
  <p>What I actually want is only get the regression results with two side fixed effects and robust S.E reported, which is very easy in Stata. I followed online tutorial but ran into some problem always with </p>
  
  <pre><code># Adjust F statistic 
  wald_results &lt;- waldtest(FE1, vcov = cov1)
  Error in model.matrix.pFormula(formula, data, rhs = 1, model = model,  : 
    NA in the individual index variable
  </code></pre>
  
  <p>no matter how I adjusted the data! It almost drives me crazy.</p>
  
  <p>here is my code:</p>
  
  <pre><code>bankFull &lt;- openxlsx::read.xlsx("bankFull.xlsx",1)
  
  attach(bankFull)
  library(plm)
  
  FE1 = plm(  RoA ~
                log(1+degreeNW)+
                ln_assets+
                log(no_of_board_members/staffNo)+
                log(no_of_branch_covered_city)+ 
                log(operation_year)+
                `RoA-1`+
                log(staffNo),
              data = bankFull, index = c("name","year"),  
              effect="twoways",na.action = na.omit,
              model= "within")
  
  # robust S.E.-----------
  library(sandwich)
  library(lmtest)   # waldtest; see also coeftest.
  library(stargazer)
  
  # Adjust standard errors
  cov1         &lt;- vcovHC(FE1, type = "HC1")
  robust_se    &lt;- sqrt(diag(cov1)) 
  
  # Adjust F statistic 
  wald_results &lt;- waldtest(FE1, vcov = cov1)
  
  # show results. how can I get the F value?
  stargazer(FE1, FE1, type = "text",
            se        = list(NULL, robust_se),
            omit.stat = "f")
  </code></pre>
  
  <p>Secondly, as the code shown, I use stargazer to demonstrate the results. I also need the adjusted F value to be shown in the table. Is there any option in the package that I can use?</p>