5d8b81e16143d6eea9e86a586fe737854c03c772,linearmodels/panel/model.py,PanelOLS,_choose_cov,#PanelOLS#Any#,496

Before Change


        
        cov_est = self._cov_estimators[cov_type]
        cov_config_upd = {k: v for k, v in cov_config.items()}
        if cov_type in ("unadjusted", "homoskedastic",
                        "robust", "heteroskedastic"):
            return cov_est, cov_config_upd
        
        clusters = cov_config.get("clusters", None)
        if clusters is not None:
            clusters = PanelData(clusters, var_name="cov.cluster", convert_dummies=False)
            clusters = clusters.dataframe.copy()
        
        cluster_entity = cov_config_upd.pop("cluster_entity", False)
        if cluster_entity:

After Change


    def _choose_cov(self, cov_type, **cov_config):

        cov_est = self._cov_estimators[cov_type]
        if cov_type != "clustered":
            return cov_est, cov_config

        cov_config_upd = {k: v for k, v in cov_config.items()}

        clusters = cov_config.get("clusters", None)
        if clusters is not None:
            clusters = self.reformat_clusters(clusters).copy()
            for col in clusters.dataframe:
                cat = pd.Categorical(clusters.dataframe[col])
                clusters.dataframe[col] = cat.codes.astype(np.int64)
            clusters = clusters.dataframe
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: bashtage/linearmodels
Commit Name: 5d8b81e16143d6eea9e86a586fe737854c03c772
Time: 2017-04-07
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/model.py
Class Name: PanelOLS
Method Name: _choose_cov


Project Name: bashtage/linearmodels
Commit Name: 5d8b81e16143d6eea9e86a586fe737854c03c772
Time: 2017-04-07
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/model.py
Class Name: FirstDifferenceOLS
Method Name: _choose_cov


Project Name: bashtage/linearmodels
Commit Name: 5d8b81e16143d6eea9e86a586fe737854c03c772
Time: 2017-04-07
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/model.py
Class Name: BetweenOLS
Method Name: _choose_cov