class_docstr:     An abstract statistical model class for panel (longitudinal) datasets.
  
      Parameters
      ----------
      endog : array_like or str
          If a pandas object is used then endog should be the name of the
          endogenous variable as a string.
  #    exog
  #    panel_arr
  #    time_arr
      panel_data : pandas.Panel object
  
      Notes
      -----
      If a pandas object is supplied it is assumed that the major_axis is time
      and that the minor_axis has the panel variable.
      
class_docstr_tok: ["An","abstract","statistical","model","class","for","panel","(","longitudinal",")","datasets",".","Parameters","--","--","--","--","--","endog",":","array_like","or","str","If","a","pandas","object","is","used","then","endog","should","be","the","name","of","the","endogenous","variable","as","a","string",".","#","exog","#","panel_arr","#","time_arr","panel_data",":","pandas.Panel","object","Notes","--","--","-","If","a","pandas","object","is","supplied","it","is","assumed","that","the","major_axis","is","time","and","that","the","minor_axis","has","the","panel","variable","."]
code: def _fit_fixed(self, method, effects):
      endog = self.endog
      exog = self.exog
      demeantwice = False
      if effects in ["oneway", "twoways"]:
          if effects == "twoways":
              demeantwice = True
              effects = "oneway"
          endog_mean, counts = self._group_mean(
              endog, index=effects, counts=True
          )
          exog_mean = self._group_mean(exog, index=effects)
          counts = counts.astype(int)
          endog = endog - np.repeat(endog_mean, counts)
          exog = exog - np.repeat(exog_mean, counts, axis=0)
      if demeantwice or effects == "time":
          endog_mean, dummies = self._group_mean(
              endog, index="time", dummies=True
          )
          exog_mean = self._group_mean(exog, index="time")
          # This allows unbalanced panels
          endog = endog - np.dot(endog_mean, dummies)
          exog = exog - np.dot(dummies.T, exog_mean)
      fefit = GLS(endog, exog[:, -self._cons_index]).fit()
      # TODO: might fail with one regressor
      return fefit
  
imports: from functools import reduce
  import numpy
  from statsmodels.regression.linear_model import GLS
  from pandas import Panel
label_desc: Use image node_id 7 for calling the PanelModel obj's underlying member method code with example usage: obj._fit_fixed(method, effects) and returns: fefit