
    >h}                        S SK JrJrJr  S SKrS SKJr  S SKrS SKr	S SK
Jr  S SKJrJrJrJr  SSKJr  SS jrSS	 jr  SS
 jrSS jrSS jr  SS jr  SS jr  SS jr  SS jrSS jrSS jr " S S5      rg)     )lmaplrangelzipN)zip_longest)SimpleTable)fmt_2	fmt_2cols
fmt_paramsgen_fmt   )_model_typesc                    [         R                  " U 5      n US:X  a(  [        U 5      S:  d  [        U 5      S:  a  SU -  $ SU -  $ US:X  a(  [        U 5      S:  d  [        U 5      S:  a  SU -  $ SU -  $ [        S	R	                  US
95      e)N   g     @g-C6?z%9.3gz%9.3f   z%10.4gz%10.4fz1`prec` argument must be either 3 or 4, not {prec}prec)npsqueezeabs
ValueErrorformat)xr   s     lC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\statsmodels/iolib/summary.pyforgr      s    


1AqyFcMs1v}Q;Q;	FcMs1v}a<a<L &d&+- 	-    c                 t    [         R                  " U 5      (       a  US-
  S-  S-   $ U S-  U :X  a  SU -  $ SU -  $ )a=  convert number to string with either integer of float formatting

This is used internally for nobs and degrees of freedom which are usually
integers but can be float in some cases.

Parameters
----------
x : int or float
width : int
    only used if x is nan

Returns
-------
str : str
    number as formatted string
r    NaNr   z%#6dz%#8.2f)r   isnan)r   widths     r   d_or_fr!   &   sD    " 
xx{{	S 5((Av{z!|r   c                 N  ^'^( US:X  a'  [         U R                  R                  R                     nUbO  [	        U5      [	        U R
                  5      :w  a-  [        SR                  [	        U R
                  5      5      5      e[        XU5      u  p[        R                  " 5       n[        R                  " SU5      /n[        R                  " SU5      n	U R                  R                  R                  n
U R                  nU R                  nU R                  nSU
/4SU	/4SU4S	U/4/n[        U6 u  nnUnSn[!        UUUU["        S
9nSnU
/UU/U/4n[!        UUUU["        S
9nUR%                  U5        Um'U R'                  5       U R'                  5       U R'                  5       U R'                  5       U R'                  5       U R'                  5       S.nU R(                  U R(                  U R(                  U R(                  U R(                  U R(                  S.n[+        SU-
  S-  5      S-   nSSSSUS-   /SSSSUS-   /SSSSUS-   /SSSSUS-   /SSSSUS-   /SSSSUS-   /S.nUnU R
                  nU R-                  U5      nU R.                  n[1        [	        U5      5      nUU
   n UU
   n![3        U V"s/ s H  n"SUU"   -  PM     sn"U V"s/ s H  n"SUU"   -  PM     sn"U V"s/ s H  n"SU U"   -  PM     sn"U V"s/ s H  n"SU!U"   -  PM     sn"U V"s/ s H  n"S[5        UU"   5      -  PM     sn"5      n#[!        U#UU
   US[6        S
9m(U'U(4S jn$U'U(4S jn%U$U%S.n&US:X  a   U&U
   " 5       $ gs  sn"f s  sn"f s  sn"f s  sn"f s  sn"f ! [8         a    U&S   " 5       s $ f = f) a$  
Parameters
----------
yname : str
        optional, Default is `Y`
xname : list[str]
        optional, Default is `X.#` for # in p the number of regressors
Confidance interval : (0,1) not implimented
title : str
        optional, Defualt is 'Generalized linear model'
returns : str
          'text', 'table', 'csv', 'latex', 'html'

Returns
-------
Default :
returns='print'
        Prints the summarirized results

Option :
returns='text'
        Prints the summarirized results

Option :
returns='table'
         SimpleTable instance : summarizing the fit of a linear model.

Option :
returns='csv'
        returns a string of csv of the results, to import into a spreadsheet

Option :
returns='latex'
Not implimented yet

Option :
returns='HTML'
Not implimented yet


Examples (needs updating)
--------
>>> import statsmodels as sm
>>> data = sm.datasets.longley.load()
>>> data.exog = sm.add_constant(data.exog)
>>> ols_results = sm.OLS(data.endog, data.exog).results
>>> print ols_results.summary()
...

Notes
-----
conf_int calculated from normal dist.
r   Nz`User supplied xnames must have the same number of entries as the number of model parameters ({})%H:%M:%S%a, %d %b %YModel type:Date:Dependent Variable:zdf modeltitletxt_fmt)zMethod:Time:Number of Obs:zdf resid)OLSGLSGLSARWLSRLMGLMr   d   %coefstd errtP>|t|z Conf. IntervalzP>|z|)r-   r.   r/   r0   r2   r1   z%#6.4gz%#6.4fz(%#5g, %#5g)c                  <   > [        T5      S-   [        T5      -   n U $ )z$
print summary table for ols models

strtablegeneral_tableparameter_tables    r   ols_printersummary.<locals>.ols_printer   s#     M"4'O(<<r   c                  <   > [        T5      S-   [        T5      -   n U $ )Nr<   r=   r?   s    r   glm_printersummary.<locals>.glm_printer   s!    M"4'O(<<r   )r-   r2   printr-   )r   model	__class____name__lenparamsr   r   	_getnamestime	localtimestrftimenobsdf_modeldf_residr   r   r   extend_rightr7   pvaluesr>   conf_intbser   r   tupler   KeyError))selfynamexnamer)   alphareturns
model_infotime_nowtime_of_daydate	modeltyperR   rS   rT   gen_leftgen_stubs_leftgen_data_left	gen_title
gen_headergen_table_leftgen_stubs_rightgen_data_rightgen_table_righttstats
prob_statsalpparam_headerparams_stubsrM   rW   std_errexog_lentstat	prob_statiparams_datarC   rF   printersrA   rB   s)                                          @@r   summaryrz   @   s   n zTZZ11::;SZ3t{{+;;   &s4;;'7 8: 	: T%0LE~~H==X67K==2D

$$--I99D}}H}}H ,4&!&.hZ(H
 %0$:!NMIJ !+!/'0)0	#N#O !k!fjN
 ".","1(1*1	$O 0"M VVXVVXvvxVVXVVXVVXF <<J qwm
S
 CIsGS;L5LMIsGS;L5LMIsGS;L5LMIsGS;L5LMIsGS;L5LMIsGS;L5LML L[[F}}U#HhhGc%j!H9E9%I A1F1I.A9ABAGAJ/B7?@x!E!H-x@;CD8aIaL18DEMNXx{);;XN	PK
 "+".y"9".(,*/	$O  #;7H'	%I&(( E BB@DNB  	%E?$$	%s0   9M4M9
)M>NN)	N N$#N$c                 D   Uc1  [        U R                  SS5      b  U R                  R                  nOSnUcb  [        U R                  SS5      b  U R                  R                  nX4$ [	        [        U R                  5      5       Vs/ s H  nSU-  PM
     nnX4$ s  snf )z0extract names from model or construct names
    Nendog_namesy
exog_nameszvar_%d)getattrrI   r|   r~   rangerL   rM   )r[   r\   r]   rw   s       r   rN   rN      s     }4::}d3?JJ**EE}4::|T2>JJ))E < ,1T[[1A+BC+BaX\+BEC< Ds   	Bc                   ^ ^^^ X#pv[         R                  " 5       n[         R                  " SU5      /m[         R                  " SU5      m[        T TUS9u  mn[	        SU4S j4SU4S j4SU 4S	 j4S
U4S j4SU4S j4SU 4S j4SU 4S j4SU 4S j4SU 4S j4SU 4S j4/
5      n	Uc#  T R
                  R                  R                  S-   nUc$  / SQn T R                  n
UR                  S5        / nUnSn/ nU H#  u  pUc	  X   " 5       nUR                  X45        M%     UnU(       a-  / nU H#  u  pUc	  X   " 5       nUR                  X45        M%     UnXg-    VVs/ s H  u  nnUb  M  UPM     nnnU/ :X  d   U5       eU(       a  [        U5      [        U5      :  a  US/[        U5      [        U5      -
  -  -  nO6[        U5      [        U5      :  a  US/[        U5      [        U5      -
  -  -  nU VVs/ s H  u  nnSSU-   -  U4PM     nnn[        U6 u  nn[        UUUU[        S9nO/ n[        U6 u  nn[        UUUU[        S9nUR                  U5        UnU$ !    GNz= fs  snnf s  snnf ) zgenerate top table(s)


TODO: this still uses predefined model_methods
? allow gleft, gright to be 1 element tuples instead of filling with None?

r#   r$   r\   r]   r'   c                  
   > T /$ N r\   s   r   <lambda>summary_top.<locals>.<lambda>&  s    5'r   Dep. Variable:c                  
   > T /$ r   r   r   s   r   r   r   '  s    eWr   zModel:c                  F   > T R                   R                  R                  /$ r   )rI   rJ   rK   resultss   r   r   r   (  s    gmm55>>?r   r&   c                  
   > T /$ r   r   )rc   s   r   r   r   )  s    TFr   r+   c                     > T $ r   r   )rb   s   r   r   r   *  s    Kr   r,   c                     > T R                   /$ r   )rR   r   s   r   r   r   +  s    gll^r   No. Observations:c                  0   > [        T R                  5      /$ r   )r!   rR   r   s   r   r   r   ,  s    )=(>r   z	Df Model:c                  0   > [        T R                  5      /$ r   )r!   rS   r   s   r   r   r   -  s    (8(8!9 :r   zDf Residuals:c                  0   > [        T R                  5      /$ r   )r!   rT   r   s   r   r   r   .  s    VG,<,<%=$>r   zLog-Likelihood:c                  $   > ST R                   -  /$ )Nz%#8.5g)llfr   s   r   r   r   /  s    x'++'=&>r   NzRegression Results))r   N)r%   N)r&   N)r   N)z	Df model:N)z	Df resid:N)zLog-LikelihoodN)r   r   z%-21sz  r(   )rO   rP   rQ   rN   dictrI   rJ   rK   r   appendrL   r   r   r	   rU   )r   r)   gleftgrightr\   r]   re   	gen_rightra   default_itemsr   rh   ri   	gen_left_itemvalue
gen_right_kvmissing_valuesrk   rl   rm   rf   rg   rj   rA   rc   rb   s   `   `                      @@r   summary_topr     s     i ~~H==X67K==2DWE?LE5  /
2_
-?
@N
#'
(3
4 >
?:
;>
?>
? M }''003GG)	++COO45 	IJ I=!')E$'   H
$KD}%+-tm, % 	 $,#7E#7CAa1a#7NER// y>CM)*XY)GHHI^c(m+IX(FGGH 9BB	1ga(!,		B*5y*A'%n&0&5,5.7	(  %0$:!NM !+!/'0)2	#N 0"MA	0 F Cs   I* #
I21I2 I8*I/c                    [        U [        5      (       a  U u  pppO[        R                  " U R                  5      n[        R                  " U R
                  5      n[        R                  " U R                  5      n	[        R                  " U R                  5      n
[        R                  " U R                  U5      5      nUR                  S:X  a  [        S//5      $ U(       a*  SSSSS[        US-  5      -   [        S	US-  -
  5      S
-   /nO)SSSSS[        US-  5      -   [        S	US-  -
  5      S
-   /nU(       a  Sn[        XUS9u  p[        U5      [        U5      :w  a  [        S5      eUn[        [        U5      5      n[        R                  " U5      n[        R                  " U5      n[        R                  " U	5      n	[        R                  " U
5      n
[        R                  " U5      n[!        U Vs/ s H  n[#        UU   SS9PM     snU Vs/ s H  n[#        UU   5      PM     snU Vs/ s H  n[#        U	U   5      PM     snU Vs/ s H  nSU
U   -  PM     snU Vs/ s H  n[#        UUS4   5      PM     snU Vs/ s H  n[#        UUS	4   5      PM     sn5      n[        UUUU[$        S9nU$ s  snf s  snf s  snf s  snf s  snf s  snf )a  create a summary table for the parameters

Parameters
----------
res : results instance
    some required information is directly taken from the result
    instance
yname : {str, None}
    optional name for the endogenous variable, default is "y"
xname : {list[str], None}
    optional names for the exogenous variables, default is "var_xx"
alpha : float
    significance level for the confidence intervals
use_t : bool
    indicator whether the p-values are based on the Student-t
    distribution (if True) or on the normal distribution (if False)
skip_headers : bool
    If false (default), then the header row is added. If true, then no
    header row is added.

Returns
-------
params_table : SimpleTable instance
r   zNo Model Parametersr5   r6   r7   r8   [   r   ]r9   r:   Nr   z-xnames and params do not have the same lengthr   r   z%#6.3fr(   )
isinstancerY   r   asarrayrM   rX   tvaluesrV   rW   sizer   r>   rN   rL   r   r   r   r   r
   )r   r\   r]   r^   use_tskip_headerr)   rM   rs   r   rV   rW   rq   _rr   exog_idxrw   rx   rB   s                      r   summary_paramsr     s   @ '5!! @G<7HGNN+**W[[)**W__-**W__-::g..u56{{a23455 	3c%'l*C%'	NS,@B 	3c%'l*C%'	NS,@B U;HA
5zS[ HIILc%j!HZZFjj!Gjj!Gjj!Gzz(#HBAVAYQ/B2:;(QWQZ((;2:;(QWQZ((;9ABAGAJ/B5=>XXac]+X>5=>XXac]+X>@K "+".".(-*4	$O  C;;B>>s$   >KK
9KK/KKc                 @   [        U [        5      (       a  U u  ppgpOAU R                  nU R                  nU R                  nU R
                  nU R                  U5      n	U(       a  / SQn
O/ SQn
[        XUS9u  pSSKJ	n  [        R                  " XVXxU	45      nU" XUS9$ )a  
Create a summary table for the parameters

Parameters
----------
res : results instance
    some required information is directly taken from the result
    instance
yname : {str, None}
    optional name for the endogenous variable, default is "y"
xname : {list[str], None}
    optional names for the exogenous variables, default is "var_xx"
alpha : float
    significance level for the confidence intervals
use_t : bool
    indicator whether the p-values are based on the Student-t
    distribution (if True) or on the normal distribution (if False)
skip_headers : bool
    If false (default), then the header row is added. If true, then no
    header row is added.

Returns
-------
params_table : SimpleTable instance
)r5   r6   r7   r8   Conf. Int. LowConf. Int. Upp.)r5   r6   r9   r:   r   r   r   r   )	DataFrame)columnsindex)r   rY   rM   rX   r   rV   rW   rN   pandasr   r   column_stack)r   r\   r]   r^   r   rM   rs   r   rV   rW   rq   r   r   r@   s                 r   summary_params_framer     s    B '5!! @G<7H++////##E* == U;HA OOVgIJEU>>r   c                    Uc@  [         R                  " U R                  R                  5      SS  Vs/ s H  nSU-  PM
     nnUc1  [	        [        U R                  5      5       Vs/ s H  nSU-  PM
     nnU R                   VVs/ s H  of Vs/ s H  n[        USS9PM     snPM     nnnU(       a  U V	V
Vs/ s HQ  n	[        X	5       V
Vs/ s H5  n
U
 Vs/ s H$  nSS[        US	S9R                  5       -   S
-   -  PM&     snPM7     snn
PMS     nn
n	n[        U/UQ76 nU VVs/ s H  o  H  oUPM     M     nnn[        U/S/[        U5      -  /[        U5      -  Q76 nU VVs/ s H  o  H  oUPM     M     nnnOUnUn[        R                  " [        5      nS/U R                  R                  S   -  US'   [        XUUUS9$ s  snf s  snf s  snf s  snnf s  snf s  snn
f s  snn
n	f s  snnf s  snnf )a*  create summary table of regression parameters with several equations

This allows interleaving of parameters with bse and/or tvalues

Parameters
----------
result : result instance
    the result instance with params and attributes in extras
extras : list[str]
    additional attributes to add below a parameter row, e.g. bse or tvalues
endog_names : {list[str], None}
    names for rows of the parameter array (multivariate endog)
exog_names : {list[str], None}
    names for columns of the parameter array (exog)
alpha : float
    level for confidence intervals, default 0.95
title : None or string

Returns
-------
tables : list of SimpleTable
    this contains a list of all seperate Subtables
table_all : SimpleTable
    the merged table with results concatenated for each row of the parameter
    array

Nr   zendog_%dzvar%dr   r   z%10s(r   ) z%s	data_fmts)headersstubsr)   r*   )r   uniquerI   endogr   rL   rM   r   r   stripr   copydeepcopyr
   shaper   )resultextrasr|   r~   r)   rw   rowr   
res_paramswhatcolr   extras_listdatajr   r*   s                    r   summary_params_2dr     s   :  yy!3!34QR8:8 +,zA~8 	 :+0V]]1C+DE+Dagk+D
E CI--P-3#6#$41%#6-JP $* $*4 $+6#8:#8C #&'"%Q  3aa)>)>)@#@3#FG"%'#8: $* 	 
 J--+4aA4+[GRD[)9$9#:3v;#FG!-Eq1a1E-mmJ'G 6&--"5"5a"88GKt#(#(%,. .1: F 7P' :  ,-sY   G'G	GG$G;G,
G&+G!G&G,(G3*G9G!G&&G,c           
         U nUR                   nUR                  S:X  a7  UR                  S   n	[        U5      UR                  S   :w  a  [	        S5      eO%[        U5      [        U5      :w  a  [	        S5      eSn	[        U[        5      (       d!  Uc  Sn
OUn
UR                  R                  SS n/ n[        U	5       H  nXwR                   SS2U4   UR                  SS2U4   UR                  SS2U4   UR                  SS2U4   UR                  U5      U   4nSn[        XU   X#UUS9nUR                  U5        M     [        [        U5      5       H  nUU   UU   l        M     [#        XS9nUU4$ )	ag  summary table for parameters that are 2d, e.g. multi-equation models

Parameters
----------
result : result instance
    the result instance with params, bse, tvalues and conf_int
endog_names : {list[str], None}
    names for rows of the parameter array (multivariate endog)
exog_names : {list[str], None}
    names for columns of the parameter array (exog)
alpha : float
    level for confidence intervals, default 0.95
use_t : bool
    indicator whether the p-values are based on the Student-t
    distribution (if True) or on the normal distribution (if False)
keep_headers : bool
    If true (default), then sub-tables keep their headers. If false, then
    only the first headers are kept, the other headerse are blanked out
endog_cols : bool
    If false (default) then params and other result statistics have
    equations by rows. If true, then equations are assumed to be in columns.
    Not implemented yet.

Returns
-------
tables : list of SimpleTable
    this contains a list of all seperate Subtables
table_all : SimpleTable
    the merged table with results concatenated for each row of the parameter
    array

r   r   zendog_names has wrong lengthNr   F)r\   r]   r^   r   r   )keep_headers)rM   ndimr   rL   r   r   listrI   r|   r   rX   r   rV   rW   r   r   r)   table_extend)r   r|   r~   r^   r   r   
endog_colsresrM   n_equendog_basenametableseqrestupskiphtblerw   	table_alls                     r   summary_params_2dflatr   T  s{   F CZZF{{aQ{v||A.;<< / {s6{*;<< k4(($N(Nii++AB/FElzz!B$'2AbD8I++ad#S\\%%8%<> fO$.5*/1 	d  3{#$%a.q	 % V?I9r   c                    SSK Jn  [        U SS 5       H  u  p4U" U5      nUS   R                  S:X  ad  UR                  US   S   l        SUS   S   l        US   S   R                  US   S   l        U(       d  US:  a  US   SS  H
  nSUl        M     US:X  a  UnM  WS   nUR                  SS	S
9  UR                  U5        M     SWl        U$ )a  extend a list of SimpleTables, adding titles to header of subtables

This function returns the merged table as a deepcopy, in contrast to the
SimpleTable extend method.

Parameters
----------
tables : list of SimpleTable instances
keep_headers : bool
    If true, then all headers are kept. If falls, then the headers of
    subtables are blanked out.

Returns
-------
table_all : SimpleTable
    merged tables as a single SimpleTable instance

r   )r   Nheaderr   r   txt-)row_dec_below)
r   r   	enumeratedatatyper)   r   	_datatyper   
add_formatextend)r   r   r   iir7   cr   r1s           r   r   r     s    & 6!9%QK Q4==H$77AaDGL $AaDGA$q'++AaDGKR!V1abAAF " 7I2BMM%sM3Q' &* IOr   c                    US:X  a0  S nSR                  [        X S S 5      [        U S   5      /-   5      $ US:X  a  U $ US:X  a  SR                  S U  5       5      $ US:X  aF  [        R                  " U S	   5      nU S
S   H  nUR                  U5        M     UR                  5       $ US:X  a  SR                  S U  5       5      $ [        S5      e)Ntextc                 >    [        U 5      R                  SS5      S   $ )Nr<   r   r   )r>   rsplit)r   s    r   r    summary_return.<locals>.<lambda>  s    CFMM$q1!4r   r<   r   r   csvc              3   @   #    U  H  oR                  5       v   M     g 7fr   )as_csv).0r   s     r   	<genexpr>!summary_return.<locals>.<genexpr>  s     4VV   latexr   r   htmlc              3   @   #    U  H  oR                  5       v   M     g 7fr   as_html)r   r@   s     r   r   r     s     =fUfr   z3available output formats are text, csv, latex, html)joinr   r>   r   r   r   as_latex_tabularr   )r   
return_fmtstrdropr@   parts        r   summary_returnr    s    V4yygcr{3s6":6GGHH	x		u	yy4V444	w	fQi(12JDLL %%''	v	yy=f===NOOr   c                   p    \ rS rSrSrS rS rS rS rS r	  SS	 jr
  SS
 jrS rS rS rS rS rSrg)Summaryi  a{  
Result summary

Construction does not take any parameters. Tables and text can be added
with the `add_` methods.

Attributes
----------
tables : list of tables
    Contains the list of SimpleTable instances, horizontally concatenated
    tables are not saved separately.
extra_txt : str
    extra lines that are added to the text output, used for warnings
    and explanations.
c                      / U l         S U l        g r   )r   	extra_txtr[   s    r   __init__Summary.__init__  s    r   c                 "    U R                  5       $ r   )as_textr  s    r   __str__Summary.__str__  s    ||~r   c                 X    [        [        U 5      5      S-   U R                  5       -   S-   $ )Nz
"""
z
""")r>   typer  r  s    r   __repr__Summary.__repr__  s%    4:*T\\^;gEEr   c                 "    U R                  5       $ )z$Display as HTML in IPython notebook.r   r  s    r   _repr_html_Summary._repr_html_  s    ||~r   c                 "    U R                  5       $ )z9Display as LaTeX when converting IPython notebook to PDF.)as_latexr  s    r   _repr_latex_Summary._repr_latex_  s    }}r   Nc           	      P    [        XX4XVS9nU R                  R                  U5        g)a  
Add a double table, 2 tables with one column merged horizontally

Parameters
----------
res : results instance
    some required information is directly taken from the result
    instance
title : str, optional
    if None, then a default title is used.
gleft : list[tuple], optional
    elements for the left table, tuples are (name, value) pairs
    If gleft is None, then a default table is created
gright : list[tuple], optional
    elements for the right table, tuples are (name, value) pairs
yname : str, optional
    optional name for the endogenous variable, default is "y"
xname : list[str], optional
    optional names for the exogenous variables, default is "var_xx".
    Must match the number of parameters in the model.
)r)   r   r   r\   r]   N)r   r   r   )r[   r   r)   r   r   r\   r]   r@   s           r   add_table_2colsSummary.add_table_2cols	  s'    0 CE"'65!r   c                     UR                   R                  S:X  a  [        XX4US9nO3UR                   R                  S:X  a  [        XUXES9u  pvO[	        S5      eU R
                  R                  U5        g)aZ  create and add a table for the parameter estimates

Parameters
----------
res : results instance
    some required information is directly taken from the result
    instance
yname : {str, None}
    optional name for the endogenous variable, default is "y"
xname : {list[str], None}
    optional names for the exogenous variables, default is "var_xx"
alpha : float
    significance level for the confidence intervals
use_t : bool
    indicator whether the p-values are based on the Student-t
    distribution (if True) or on the normal distribution (if False)

Returns
-------
None : table is attached

r   )r\   r]   r^   r   r   )r|   r~   r^   r   zparams has to be 1d or 2dN)rM   r   r   r   r   r   r   )r[   r   r\   r]   r^   r   r@   r   s           r   add_table_paramsSummary.add_table_params%  sl    0 ::??a"35).0EZZ__!,S8=38GHAu 8995!r   c                 0    SR                  U5      U l        g)zadd additional text that will be added at the end in text format

Parameters
----------
etext : list[str]
    string with lines that are added to the text output.

r<   N)r  r
  )r[   etexts     r   add_extra_txtSummary.add_extra_txtH  s     5)r   c                 l    [        U R                  SS9nU R                  b  US-   U R                  -   nU$ )zdreturn tables as string

Returns
-------
txt : str
    summary tables and extra text as one string

r   r  

r  r   r
  )r[   r   s     r   r  Summary.as_textS  s5     T[[V<>>%,/C
r   c                     [        U R                  SS9nU R                  b"  US-   U R                  R                  SS5      -   nU$ )a  return tables as string

Returns
-------
latex : str
    summary tables and extra text as string of Latex

Notes
-----
This currently merges tables with different number of columns.
It is recommended to use `as_latex_tabular` directly on the individual
tables.

r   r(  r)  r<   z \newline
 r  r   r
  replace)r[   r   s     r   r  Summary.as_latexa  sB     t{{w?>>%FNT^^%;%;D/%RREr   c                 l    [        U R                  SS9nU R                  b  US-   U R                  -   nU$ )znreturn tables as string

Returns
-------
csv : str
    concatenated summary tables in comma delimited format

r   r(  r)  r*  )r[   r   s     r   r   Summary.as_csvu  s5     T[[U;>>%,/C
r   c                     [        U R                  SS9nU R                  b"  US-   U R                  R                  SS5      -   nU$ )zdreturn tables as string

Returns
-------
html : str
    concatenated summary tables in HTML format

r   r(  z
<br/><br/>r<   z<br/>r-  )r[   r   s     r   r   Summary.as_html  sC     dkkf=>>%,&)?)?g)NNDr   )r
  r   NNNNNNN皙?T)rK   
__module____qualname____firstlineno____doc__r  r  r  r  r  r  r!  r%  r  r  r   r   __static_attributes__r   r   r   r  r    sY    F DH*."8 CF#!"F	*(r   r  )r   )   )NNr   r6  r   N)NNr4  )NNr6  TFNr5  )NNNN)NNr6  TTF)T)r   )statsmodels.compat.pythonr   r   r   r   	itertoolsr   rO   numpyr   statsmodels.iolib.tabler   !statsmodels.iolib.tableformattingr   r	   r
   r   summary2r   r   r!   rz   rN   r   r   r   r   r   r   r  r  r   r   r   <module>rC     s    8 8  !   /  #-$4 :='+|%~$pf FJ,0Sl AD#:?z IM :.z LPDIM`*ZP,h hr   