Skip to contents

This function is very similar to usual summary functions as it provides the table of coefficients along with other information on the fit of the estimation. The type of output can be customized by the user (using function setFixest_print).

Usage

# S3 method for fixest
print(x, n, type = "table", fitstat = NULL, ...)

setFixest_print(type = "table", fitstat = NULL)

getFixest_print()

Arguments

x

A fixest object. Obtained using the methods femlm, feols or feglm.

n

Integer, number of coefficients to display. By default, only the first 8 coefficients are displayed if x does not come from summary.fixest.

type

Either "table" (default) to display the coefficients table or "coef" to display only the coefficients.

fitstat

A formula or a character vector representing which fit statistic to display. The types must be valid types of the function fitstat. The default fit statistics depend on the type of estimation (OLS, GLM, IV, with/without fixed-effect). Providing the argument fitstat overrides the default fit statistics, you can however use the point "." to summon them back. Ex 1: fitstat = ~ . + ll adds the log-likelihood to the default values. Ex 2: fitstat = ~ ll + pr2 only displays the log-likelihood and the pseudo-R2.

...

Other arguments to be passed to vcov.fixest.

Details

It is possible to set the default values for the arguments type and fitstat by using the function setFixest_print.

See also

See also the main estimation functions femlm, feols or feglm. Use summary.fixest to see the results with the appropriate standard-errors, fixef.fixest to extract the fixed-effects coefficients, and the function etable to visualize the results of multiple estimations.

Author

Laurent Berge

Examples


# Load trade data
data(trade)

# We estimate the effect of distance on trade
#   => we account for 3 fixed-effects (FEs)
est_pois = fepois(Euros ~ log(dist_km)|Origin+Destination+Product, trade)

# displaying the results
#  (by default SEs are clustered if FEs are used)
print(est_pois)
#> Poisson estimation, Dep. Var.: Euros
#> Observations: 38,325 
#> Fixed-effects: Origin: 15,  Destination: 15,  Product: 20
#> Standard-errors: Clustered (Origin) 
#>              Estimate Std. Error  t value  Pr(>|t|)    
#> log(dist_km) -1.52775   0.115627 -13.2127 < 2.2e-16 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> Log-Likelihood: -7.133e+11   Adj. Pseudo R2: 0.760389
#>            BIC:  1.427e+12     Squared Cor.: 0.60377 

# By default the coefficient table is displayed.
#  If the user wished to display only the coefficents, use option type:
print(est_pois, type = "coef")
#> log(dist_km) 
#>    -1.527747 

# To permanently display coef. only, use setFixest_print:
setFixest_print(type = "coef")
est_pois
#> log(dist_km) 
#>    -1.527747 
# back to default:
setFixest_print(type = "table")

#
# fitstat
#

# We modify which fit statistic to display
print(est_pois, fitstat = ~ . + lr)
#> Poisson estimation, Dep. Var.: Euros
#> Observations: 38,325 
#> Fixed-effects: Origin: 15,  Destination: 15,  Product: 20
#> Standard-errors: Clustered (Origin) 
#>              Estimate Std. Error  t value  Pr(>|t|)    
#> log(dist_km) -1.52775   0.115627 -13.2127 < 2.2e-16 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> Log-Likelihood: -7.133e+11   Adj. Pseudo R2: 0.760389
#>            BIC:  1.427e+12     Squared Cor.: 0.60377 
#> LR: stat = 4.527e+12, p < 2.2e-16, on 49 DoF.

# We add the LR test to the default (represented by the ".")

# to show only the LR stat:
print(est_pois, fitstat = ~ . + lr.stat)
#> Poisson estimation, Dep. Var.: Euros
#> Observations: 38,325 
#> Fixed-effects: Origin: 15,  Destination: 15,  Product: 20
#> Standard-errors: Clustered (Origin) 
#>              Estimate Std. Error  t value  Pr(>|t|)    
#> log(dist_km) -1.52775   0.115627 -13.2127 < 2.2e-16 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> Log-Likelihood: -7.133e+11   Adj. Pseudo R2: 0.760389 
#>            BIC:  1.427e+12     Squared Cor.: 0.60377  
#>                                   LR, stat.: 4.527e+12

# To modify the defaults:
setFixest_print(fitstat = ~ . + lr.stat + rmse)
est_pois
#> Poisson estimation, Dep. Var.: Euros
#> Observations: 38,325 
#> Fixed-effects: Origin: 15,  Destination: 15,  Product: 20
#> Standard-errors: Clustered (Origin) 
#>              Estimate Std. Error  t value  Pr(>|t|)    
#> log(dist_km) -1.52775   0.115627 -13.2127 < 2.2e-16 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> Log-Likelihood: -7.133e+11   Adj. Pseudo R2: 0.760389    
#>            BIC:  1.427e+12     Squared Cor.: 0.60377     
#>      LR, stat.:  4.527e+12             RMSE: 88,419,292.2

# Back to default (NULL == default)
setFixest_print(fitstat = NULL)