Skip to content

Commit

Permalink
fix build error in mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
s3alfisc committed Mar 19, 2023
1 parent 9f2becf commit 12d1708
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 177 deletions.
62 changes: 33 additions & 29 deletions pyfixest/fixest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def _demean(self):
# type checking
i0_type = self.data[ivars[0]].dtype
i1_type = self.data[ivars[1]].dtype
if not i0_type in ['category', "O"]:
if not i0_type in ['category', "O"]:
raise ValueError("Column " + ivars[0] + " is not of type 'O' or 'category', which is required in the first position of i(). Instead it is of type " + i0_type.name + ".")
if not i1_type:
if not i1_type:
raise ValueError("Column " + ivars[1] + " is not of type 'int' or 'float', which is required in the second position of i(). Instead it is of type " + i1_type.name + ".")

else:
Expand Down Expand Up @@ -178,14 +178,17 @@ def feols(self, fml: str, vcov: Union[str, Dict[str, str]]) -> None:
Args:
fml (str): A two-sided formula string using fixest formula syntax. Supported syntax includes:
- Stepwise regressions (sw, sw0)
- Cumulative stepwise regression (csw, csw0)
- Multiple dependent variables (Y1 + Y2 ~ X)
- Interacted fixed effects (e.g. "fe1^fe2" for interaction between fe1 and fe2)
Stepwise regressions (sw, sw0)
Cumulative stepwise regression (csw, csw0)
Multiple dependent variables (Y1 + Y2 ~ X)
Interacted fixed effects (e.g. "fe1^fe2" for interaction between fe1 and fe2)
All other parts of the formula must be compatible with formula parsing via the formulaic module.
vcov (str or dict): A string or dictionary specifying the type of variance-covariance matrix to use for inference.
vcov (Union(str, dict)): A string or dictionary specifying the type of variance-covariance matrix to use for inference.
If a string, it can be one of "iid", "hetero", "HC1", "HC2", "HC3".
If a dictionary, it should have the format {"CRV1":"clustervar"} for CRV1 inference or {"CRV3":"clustervar"} for CRV3 inference.
If a dictionary, it should have the format dict("CRV1":"clustervar") for CRV1 inference or dict(CRV3":"clustervar") for CRV3 inference.
Returns:
None
Examples:
Standard formula:
Expand Down Expand Up @@ -213,7 +216,7 @@ def feols(self, fml: str, vcov: Union[str, Dict[str, str]]) -> None:
self.fml_dict = fxst_fml.fml_dict
self.var_dict = fxst_fml.var_dict
self.ivars = fxst_fml.ivars

self._demean()

for _, fval in enumerate(self.fml_dict.keys()):
Expand Down Expand Up @@ -254,6 +257,9 @@ def vcov(self, vcov: Union[str, Dict[str, str]]) -> None:
If a string, can be one of "iid", "hetero", "HC1", "HC2", "HC3".
If a dictionary, it should have the format {"CRV1":"clustervar"} for CRV1 inference
or {"CRV3":"clustervar"} for CRV3 inference.
Returns:
None
'''

for model in list(self.model_res.keys()):
Expand All @@ -269,25 +275,23 @@ def tidy(self, type: Optional[str] = None) -> Union[pd.DataFrame, str]:
'''
Returns the results of an estimation using `feols()` as a tidy Pandas DataFrame.
Parameters
----------
type : str, optional
The type of output format to use. If set to "markdown", the resulting DataFrame
will be returned in a markdown format with three decimal places. Default is None.
Returns
-------
pd.DataFrame or str
A tidy DataFrame with the following columns:
- fml: the formula used to generate the results
- coefnames: the names of the coefficients
- Estimate: the estimated coefficients
- Std. Error: the standard errors of the estimated coefficients
- t value: the t-values of the estimated coefficients
- Pr(>|t|): the p-values of the estimated coefficients
If `type` is set to "markdown", the resulting DataFrame will be returned as a
markdown-formatted string with three decimal places.
Args:
type : str, optional
The type of output format to use. If set to "markdown", the resulting DataFrame
will be returned in a markdown format with three decimal places. Default is None.
Returns:
pd.DataFrame or str
A tidy DataFrame with the following columns:
- fml: the formula used to generate the results
- coefnames: the names of the coefficients
- Estimate: the estimated coefficients
- Std. Error: the standard errors of the estimated coefficients
- t value: the t-values of the estimated coefficients
- Pr(>|t|): the p-values of the estimated coefficients
If `type` is set to "markdown", the resulting DataFrame will be returned as a
markdown-formatted string with three decimal places.
'''

Expand Down Expand Up @@ -357,7 +361,7 @@ def iplot(self):
'''

ivars = self.icovars

ref = int(list(self.ivars.keys())[0])

if ivars is None:
Expand Down
Loading

0 comments on commit 12d1708

Please sign in to comment.