Repository: statsmodels/statsmodels

Issue:
RegressionResultsWrapper.fvalue, typically scalar, becomes 2D array with robust standard errors
#### Describe the bug

```python3
In [1]: from statsmodels.datasets import grunfeld                                                                                                                                                

In [2]: from statsmodels.api import OLS                                                                                                                                                          

In [3]: data = grunfeld.load_pandas().data.set_index(['firm','year'])                                                                                                                            

In [4]: mod = OLS(data.invest, data[['value','capital']])                                                                                                                                        

In [5]: mod.fit().fvalue                                                                                                                                                                         
Out[5]: 656.9203978616093

In [6]: mod.fit(cov_type='HC1').fvalue                                                                                                                                                           
Out[6]: array([[194.95274665]])
```
Notice that ``Out[5]`` is a scalar but ``Out[6]`` is a 2D (1x1) numpy array.

This popped out in https://github.com/mwburke/stargazer/issues/33 .

#### Expected Output

Same format (scalar, I guess).

#### Output of ``import statsmodels.api as sm; sm.show_versions()``

<details>

INSTALLED VERSIONS
------------------
Python: 3.7.3.final.0
OS: Linux 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64
byteorder: little
LC_ALL: None
LANG: it_IT.UTF-8

statsmodels
===========

Installed: 0.11.1 (/home/pietro/.local/lib/python3.7/site-packages/statsmodels)

Required Dependencies
=====================

cython: 0.29.17 (/home/pietro/.local/lib/python3.7/site-packages/Cython)
numpy: 1.16.4 (/home/pietro/.local/lib/python3.7/site-packages/numpy)
scipy: 1.1.0 (/usr/lib/python3/dist-packages/scipy)
pandas: 1.1.0.dev0+276.g2495068ad (/home/pietro/nobackup/repo/pandas/pandas)
    dateutil: 2.8.0 (/home/pietro/.local/lib/python3.7/site-packages/dateutil)
patsy: 0.5.1+dev (/home/pietro/nobackup/repo/patsy/patsy)

Optional Dependencies
=====================

matplotlib: 3.0.2 (/usr/lib/python3/dist-packages/matplotlib)
    backend: TkAgg 
cvxopt: Not installed
joblib: 0.13.0 (/usr/lib/python3/dist-packages/joblib)

Developer Tools
================

IPython: 7.5.0 (/home/pietro/.local/lib/python3.7/site-packages/IPython)
    jinja2: 2.10.1 (/home/pietro/.local/lib/python3.7/site-packages/jinja2)
sphinx: 1.8.4 (/usr/lib/python3/dist-packages/sphinx)
    pygments: 2.4.2 (/home/pietro/.local/lib/python3.7/site-packages/pygments)
pytest: 4.6.3 (/home/pietro/.local/lib/python3.7/site-packages)
virtualenv: 15.1.0 (/usr/lib/python3/dist-packages)

</details>



Discussion:

Resolving patch:
diff --git a/statsmodels/regression/linear_model.py b/statsmodels/regression/linear_model.py
--- a/statsmodels/regression/linear_model.py
+++ b/statsmodels/regression/linear_model.py
@@ -1782,8 +1782,8 @@ def fvalue(self):
                     return np.nan
             ft = self.f_test(mat)
             # using backdoor to set another attribute that we already have
-            self._cache['f_pvalue'] = ft.pvalue
-            return ft.fvalue
+            self._cache['f_pvalue'] = float(ft.pvalue)
+            return float(ft.fvalue)
         else:
             # for standard homoscedastic case
             return self.mse_model/self.mse_resid


Test patch:
diff --git a/statsmodels/regression/tests/test_regression.py b/statsmodels/regression/tests/test_regression.py
--- a/statsmodels/regression/tests/test_regression.py
+++ b/statsmodels/regression/tests/test_regression.py
@@ -951,6 +951,8 @@ def test_fvalue_const_only():
     y = np.dot(x, [1., 2., 3.]) + np.random.normal(size=30)
     res = OLS(y, x, hasconst=True).fit(cov_type='HC1')
     assert not np.isnan(res.fvalue)
+    assert isinstance(res.fvalue, float)
+    assert isinstance(res.f_pvalue, float)
 
 
 def test_conf_int_single_regressor():