Movatterモバイル変換


[0]ホーム

URL:


fixest 0.13.2

bug fixes

fixest 0.13.1

bug fixes

fixest 0.13.0

Breaking changes

New Features

est=feols(mpg~ drat| cyl, mtcars)sparse_model_matrix(est,type ="lhs")#> 32 x 1 sparse Matrix of class "dgCMatrix"#>        mpg#>  [1,] 21.0#>  [2,] 21.0#>  [3,] 22.8sparse_model_matrix(est,type =c("rhs","fixef"))#> 32 x 4 sparse Matrix of class "dgCMatrix"#>      drat cyl::4 cyl::6 cyl::8#> [1,] 3.90      .      1      .#> [2,] 3.90      .      1      .#> [3,] 3.85      1      .      .# Or you can pass a (linear) formulasparse_model_matrix(mpg~i(vs)| gear^cyl,data = mtcars,type =c("rhs","fixef"))#> 32 x 10 sparse Matrix of class "dgCMatrix"#>   [[ suppressing 10 column names ‘vs::0’, ‘vs::1’, ‘gear^cyl::4_6’ ... ]]#>#>  [1,] 1 . 1 . . . . . . .#>  [2,] 1 . 1 . . . . . . .#>  [3,] . 1 . 1 . . . . . .
# we regress `Ozone` and `Temp` on all other variables but `Day`:feols(c(Ozone, Temp)~regex("!Day"), airquality)#>NOTE: 42 observations removed because of NA values (RHS: 42).#>       |-> this msg only concerns the variables common to all estimations#>                                x.1                x.2#> Dependent Var.:              Ozone               Temp#>#> Constant           -58.05* (22.97)   55.93*** (4.405)#> Solar.R           0.0496* (0.0235)    0.0114 (0.0070)#> Wind            -3.317*** (0.6458)   -0.1925 (0.2126)#> Temp             1.871*** (0.2736)#> Month              -2.992. (1.516)  2.047*** (0.4108)#> Ozone                              0.1636*** (0.0239)#> _______________ __________________ __________________#> S.E. type                      IID                IID#> Observations                   111                111#> R2                         0.61986            0.59476#> Adj. R2                    0.60552            0.57947#> ---#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

New vignette and data set

Other changes

etable

Bugs

fixest 0.12.1

Major bugs affecting Rversions <= 4.1.2

Bugs

Deprecation

fixest 0.12.0

New features

base=setNames(iris,c("y","x1","x2","x3","species"))est=feols(y~csw(x1, x2, x3), base,fsplit =~species)# We can obtain the unique number of RHSs/samples with `n_models`n_models(est,rhs =TRUE)#> [1] 3n_models(est,sample =TRUE)#> [1] 4all_tables=list()for(iin1:n_models(est,sample =TRUE)){  all_tables[[i]]=etable(est[sample = i])}do.call(rbind, all_tables)# ... the output is too long to be displayed here

Bugs

Improvements

Documentation

fixest 0.11.2

Bugs

fixest 0.11.1

Documentation bug

C++ code

fixest 0.11.0

Bug fixes

Multiple estimations

base=setNames(iris,c("y","x1","x2","x3","species"))mult_est=feols(y~csw(x.[,1:3]), base)models(mult_est)#>   id          rhs#> 1  1           x1#> 2  2      x1 + x2#> 3  3 x1 + x2 + x3
coef(mult_est)#>   id          rhs (Intercept)         x1       x2         x3#> 1  1           x1    6.526223 -0.2233611       NA         NA#> 2  2      x1 + x2    2.249140  0.5955247 0.471920         NA#> 3  3 x1 + x2 + x3    1.855997  0.6508372 0.709132 -0.5564827# Now in long formatcoef(mult_est,long =TRUE)#>    id          rhs coefficient   estimate#> 1   1           x1 (Intercept)  6.5262226#> 2   1           x1          x1 -0.2233611#> 5   2      x1 + x2 (Intercept)  2.2491402#> 6   2      x1 + x2          x1  0.5955247#> 7   2      x1 + x2          x2  0.4719200#> 9   3 x1 + x2 + x3 (Intercept)  1.8559975#> 10  3 x1 + x2 + x3          x1  0.6508372#> 11  3 x1 + x2 + x3          x2  0.7091320#> 12  3 x1 + x2 + x3          x3 -0.5564827
coeftable(mult_est)#>   id          rhs coefficient   Estimate Std. Error   t value     Pr(>|t|)#> 1  1           x1 (Intercept)  6.5262226 0.47889634 13.627631 6.469702e-28#> 2  1           x1          x1 -0.2233611 0.15508093 -1.440287 1.518983e-01#> 3  2      x1 + x2 (Intercept)  2.2491402 0.24796963  9.070224 7.038510e-16#> 4  2      x1 + x2          x1  0.5955247 0.06932816  8.589940 1.163254e-14#> 5  2      x1 + x2          x2  0.4719200 0.01711768 27.569160 5.847914e-60#> 6  3 x1 + x2 + x3 (Intercept)  1.8559975 0.25077711  7.400984 9.853855e-12#> 7  3 x1 + x2 + x3          x1  0.6508372 0.06664739  9.765380 1.199846e-17#> 8  3 x1 + x2 + x3          x2  0.7091320 0.05671929 12.502483 7.656980e-25#> 9  3 x1 + x2 + x3          x3 -0.5564827 0.12754795 -4.362929 2.412876e-05

xpd

x=""xpd(y~ .[x]+ .[NULL])#> y ~ 1 + 1
xpd(am~..("!^am"),data = mtcars)#> am ~ mpg + cyl + disp + hp + drat + wt + qsec + vs + gear + carb
base=setNames(iris,c("y","x1","x2","x3","species"))xpd(y~ x..,data = base)#> y ~ x1 + x2 + x3feols(y~ x.., base)#> OLS estimation, Dep. Var.: y#> Observations: 150#> Standard-errors: IID#>              Estimate Std. Error  t value   Pr(>|t|)#> (Intercept)  1.855997   0.250777  7.40098 9.8539e-12 ***#> x1           0.650837   0.066647  9.76538  < 2.2e-16 ***#> x2           0.709132   0.056719 12.50248  < 2.2e-16 ***#> x3          -0.556483   0.127548 -4.36293 2.4129e-05 ***#> ---#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#> RMSE: 0.310327   Adj. R2: 0.855706
lm(xpd(y~ x..), base)#> Call:#> lm(formula = xpd(y ~ x..), data = base)#>#> Coefficients:#> (Intercept)           x1           x2           x3#>      1.8560       0.6508       0.7091      -0.5565
x_all=~sepal+ petalxpd(color~ .[x_all])#> color ~ sepal + petal

etable

base=setNames(iris,c("y","x1","x2","x3","species"))est=feols(y~csw(x.[,1:3]), base)# setting the macrosetFixest_fml(..fit_ols =~ n+ ar2+ my)# summoning itetable(est,fitstat =~..fit_ols)#>                             est.1              est.2               est.3#> Dependent Var.:                 y                  y                   y#>#> Constant        6.526*** (0.4789)  2.249*** (0.2480)   1.856*** (0.2508)#> x1               -0.2234 (0.1551) 0.5955*** (0.0693)  0.6508*** (0.0667)#> x2                                0.4719*** (0.0171)  0.7091*** (0.0567)#> x3                                                   -0.5565*** (0.1275)#> _______________ _________________ __________________ ___________________#> S.E. type                     IID                IID                 IID#> Observations                  150                150                 150#> Adj. R2                   0.00716            0.83800             0.85571#> Dep. Var. mean             5.8433             5.8433              5.8433

coeftable

est=feols(mpg~ cyl+ drat+ wt, mtcars)ct=coeftable(est,list =TRUE)ct$constant$coef#> Estimate#> 39.76766ct$wt$se#> Std. Error#>  0.8293065

All estimations

base=setNames(iris,c("y","x1","x2","x3","species"))est=feols(y~ x.[1:3], base,fsplit =~species%keep%c("set","vers"))etable(est)#>                              model 1            model 2            model 3#> Sample (species)         Full sample             setosa         versicolor#> Dependent Var.:                    y                  y                  y#>#> (Intercept)        1.856*** (0.2508)  2.352*** (0.3929)  1.896*** (0.5071)#> x1                0.6508*** (0.0667) 0.6548*** (0.0925)   0.3869. (0.2045)#> x2                0.7091*** (0.0567)    0.2376 (0.2080) 0.9083*** (0.1654)#> x3               -0.5565*** (0.1275)    0.2521 (0.3469)   -0.6792 (0.4354)#> ________________ ___________________ __________________ __________________#> S.E. type                        IID                IID                IID#> Observations                     150                 50                 50#> R2                           0.85861            0.57514            0.60503#> Adj. R2                      0.85571            0.54743            0.57927

Dictionary

x="# Main varsmpg: Miles per gallonhp: Horsepower# Categorical variablescyl: Number of cylinders; vs: Engine"as.dict(x)#>                   mpg                    hp                   cyl                    vs#>    "Miles per gallon"          "Horsepower" "Number of cylinders"              "Engine"# setFixest_dict works directly with xsetFixest_dict(x)

New functions

Other

fixest 0.10.4

Hot fix

Other bug fixes

Other

fixest 0.10.3

fixest 0.10.2

Bug fixes

etable

New arguments

New features

dsb

# At first sight, it's impossible to understand what's going on.# But I assure you, it's pretty logical!# Type dsb("--help") to get some help.dollar=6reason="glory"dsb("Why do you develop packages? For .[`dollar`*c!$]?","For money? No... for .[U,''s, c?reason]!",sep ="\n")#> Why do you develop packages? For $$$$$$?#> For money? No... for G L O R Y!
xpd(~sw(.[,"disp:.[/mpg, cyl]"]))#> ~sw(disp:mpg, disp:cyl)

New argument in allestimations

New functions

# First we get the environment (the estimation is not performed!)env=feols(mpg~ disp+ drat, mtcars,only.env =TRUE)# Then we estimate: we get the reult from feols(mpg ~ disp + drat, mtcars)est_env(env)#> OLS estimation, Dep. Var.: mpg#> Observations: 32#> Standard-errors: IID#>              Estimate Std. Error  t value   Pr(>|t|)#> (Intercept) 21.844880   6.747971  3.23725 3.0167e-03 **#> disp        -0.035694   0.006653 -5.36535 9.1914e-06 ***#> drat         1.802027   1.542091  1.16856 2.5210e-01#> ---#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#> RMSE: 3.07661   Adj. R2: 0.712458# Why doing that? You can modify the env w/t incurring overheadsassign("weights.value", mtcars$wt, env)# New estimation with weightsest_env(env)#> OLS estimation, Dep. Var.: mpg#> Observations: 32#> Standard-errors: IID#>              Estimate Std. Error  t value   Pr(>|t|)#> (Intercept) 21.967576   6.320006  3.47588 1.6241e-03 **#> disp        -0.032922   0.005884 -5.59478 4.8664e-06 ***#> drat         1.505517   1.470671  1.02369 3.1444e-01#> ---#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#> RMSE: 5.08781   Adj. R2: 0.709392
# We want to place 5 in the first placeref(1:5,5)#> [1] 1 2 3 4 5#> Levels: 5 1 2 3 4# You can also bin at the same timeref(1:5, .("4:5"=4:5))#> [1] 1   2   3   4:5 4:5#> Levels: 4:5 1 2 3

Other

fixest 0.10.1

Bug fixes

Dot square bracket operator

lhs_vars=c("var1","var2")xpd(c(.[,lhs_vars])~csw(x.[,1:3]))#> c(var1, var2) ~ csw(x1, x2, x3)
name=c("Juliet","Romeo")# default behavior => vectordsb("hello .[name], what's up?")#> [1] "hello Juliet, what's up?" "hello Romeo, what's up?"# string literal in first positiondsb("hello .[' and ', name], what's up?")#> [1] "hello Juliet and Romeo, what's up?"# string literal in last positiondsb("hello .[name, ' and '], what's up?")#> [1] "hello Juliet and hello Romeo, what's up?"

bin

data(iris)plen= iris$Petal.Length# 3 parts of (roughly) equal sizetable(bin(plen,"cut::3"))#>#> [1.0; 1.9] [3.0; 4.9] [5.0; 6.9]#>         50         54         46# Three custom binstable(bin(plen,"cut::2]5]"))#>#> [1.0; 1.9] [3.0; 5.0] [5.1; 6.9]#>         50         58         42# .. same, excluding 5 in the 2nd bintable(bin(plen,"cut::2]5["))#>#> [1.0; 1.9] [3.0; 4.9] [5.0; 6.9]#>         50         54         46# Using quartilestable(bin(plen,"cut::q1]q2]q3]"))#>#> [1.0; 1.6] [1.7; 4.3] [4.4; 5.1] [5.2; 6.9]#>         44         31         41         34# Using percentilestable(bin(plen,"cut::p20]p50]p70]p90]"))#>#> [1.0; 1.5] [1.6; 4.3] [4.4; 5.0] [5.1; 5.8] [5.9; 6.9]#>         37         38         33         29         13# Mixing alltable(bin(plen,"cut::2[q2]p90]"))#>#> [1.0; 1.9] [3.0; 4.3] [4.4; 5.8] [5.9; 6.9]#>         50         25         62         13# Adding custom namestable(bin(plen,c("cut::2[q2]p90]","<2","]2; Q2]",NA,">90%")))#>         <2    ]2; Q2] [4.4; 5.8]       >90%#>         50         25         62         13
base=setNames(iris,c("y","x1","x2","x3","species"))table(base$species)#>     setosa versicolor  virginica#>         50         50         50table(bin(base$species, .("@3"="seto","@1 VIRGIN"="virg")))#>     VIRGIN versicolor     setosa#>         50         50         50

etable

base=setNames(iris,c("y","x1","x2","x3","species"))

New function

New functions,unrelated but possibly useful

Although a bit unrelated to the purpose of this package, thesefunctions are so extensively used in the author’s research that hedecided to leverage his author privileges to include them infixest to make them easier to share with co-authors.

Other new features

base=setNames(iris,c("y","x1","x2","x3","species"))y=c("y","x1")feols(.[y]~ x2, base)#> Standard-errors: IID#> Dep. var.: y#>             Estimate Std. Error t value  Pr(>|t|)#> (Intercept) 4.306603   0.078389 54.9389 < 2.2e-16 ***#> x2          0.408922   0.018891 21.6460 < 2.2e-16 ***#> ---#> Dep. var.: x1#>              Estimate Std. Error  t value   Pr(>|t|)#> (Intercept)  3.454874   0.076095 45.40188  < 2.2e-16 ***#> x2          -0.105785   0.018339 -5.76845 4.5133e-08 ***etable(feols(..("x")~ y+i(species), base))#>                                  model 1            model 2            model 3#> Dependent Var.:                       x1                 x2                 x3#>#> (Intercept)            1.677*** (0.2354) -1.702*** (0.2301) -0.4794** (0.1557)#> y                     0.3499*** (0.0463) 0.6321*** (0.0453) 0.1449*** (0.0306)#> species = versicolor -0.9834*** (0.0721)  2.210*** (0.0705) 0.9452*** (0.0477)#> species = virginica   -1.008*** (0.0933)  3.090*** (0.0912)  1.551*** (0.0617)#> ____________________ ___________________ __________________ __________________#> S.E. type                            IID                IID                IID#> Observations                         150                150                150#> R2                               0.56925            0.97489            0.93833#> Adj. R2                          0.56040            0.97438            0.93706

Other

fixest 0.10.0

Bugs fixes

Major changes

base=setNames(iris,c("y","x1","x2","x3","species"))i=2:3z="i(species)"feols(y~ x.[i]+ .[z], base)#> OLS estimation, Dep. Var.: y#> Observations: 150#> Standard-errors: IID#>                      Estimate Std. Error   t value   Pr(>|t|)#> (Intercept)          3.682982   0.107403 34.291343  < 2.2e-16 ***#> x2                   0.905946   0.074311 12.191282  < 2.2e-16 ***#> x3                  -0.005995   0.156260 -0.038368 9.6945e-01#> species::versicolor -1.598362   0.205706 -7.770113 1.3154e-12 ***#> species::virginica  -2.112647   0.304024 -6.948940 1.1550e-10 ***#> ---#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1#> RMSE: 0.333482   Adj. R2: 0.832221

Breaking changes

New features

base=setNames(iris =c("y","x1","x2","x3","species"))# Setting up the datasetFixest_estimation(data = base)# Now vcov can be used without using vcov = stuff:feols(y~ x1+ x2,~species)# => same as feols(y ~ x1 + x2, vcov = ~species)
mtcars|>feols(cyl~ mpg)# => same as feols(cyl ~ mpg, mtcars)

etable

Other

fixest 0.9.0

Bugs

Breaking changes: new i()function

Breaking changes:new default family for feglm

Breaking changes:coefplot is now split in two

etable

Sun and Abraham staggeredDiD method

fixest_multi methods

Common methods have been extended tofixest_multiobjects.

fitstat: New fit statistics

New functions

New features

Minor breaking changes

Other changes

fixest 0.8.4

Bugs

New features

Other changes

fixest 0.8.3 (2021-03-01)

Bugs

New features

fixest 0.8.2 (2021-02-11)

Bugs

Other

fixest 0.8.1 (2021-01-13)

Bugs

Sun and Abraham methodfor staggered DiD

New features

Other

fixest 0.8.0 (2020-12-14)

Bugs

IV

base= irisnames(base)=c("y","x1","x_endo","x_inst","species")base$endo_bis=0.5* base$y+0.3* base$x_inst+rnorm(150)base$inst_bis=0.2* base$x_endo+0.3* base$endo_bis+rnorm(150)# The endo/instrument is defined in a formula past a piperes_iv1=feols(y~ x1| x_endo~ x_inst, base)# Same with the species fixed-effectres_iv2=feols(y~ x1| species| x_endo~ x_inst, base)# To add multiple endogenous regressors: embed them in c()res_iv3=feols(y~ x1|c(x_endo, x_endo_bis)~ x_inst+ x_inst_bis, base)

fit statistics

Multiple estimations

aq= airquality[airquality$Month%in%5:6, ]est_split=feols(c(Ozone, Solar.R)~sw(poly(Wind,2),poly(Temp,2)),                 aq,split =~ Month)# By default: sample is the rootetable(est_split)# Let's reorder, by considering lhs the rootetable(est_split[lhs =TRUE])# Selecting only one LHS and RHSetable(est_split[lhs ="Ozone",rhs =1])# Taking the first root (here sample = 5)etable(est_split[I =1])# The first and last estimationsetable(est_split[i =c(1, .N)])

Formula macros

data(longley)# All variables containing "GNP" or "ployed" in their names are fetchedfeols(Armed.Forces~ Population+..("GNP|ployed"), longley)

New features in etable

Other new features

Improvements of theinternal algorithm

fixest 0.7.1 (2020-10-27)

Hotfixes

Improvements

New features

fixest 0.7.0 (2020-10-24)

Bugs

Internal improvements

Standard-errors, importantchanges

New function:fitstat

New features ininteract()

New features inetable

User visible changes

Deprecation

fixest 0.6.0 (2020-07-13)

Bugs

New vignettes

Major changes: etable

Major changes: dof

User visible changes

New methods

fixest 0.5.1 (2020-06-18)

Hotfix

Bugs

User visible change

Major update ofetable

Other

fixest 0.5.0 (2020-06-10)

Bug fixes

New functionality: formulamacros

New functions

Major user-visible changes

User-visible changes

New Methods

Vignette and Readme

Issuefound: convergence problems with multiples variables with varyingslopes

Error-handling

Other

fixest 0.4.1 (2020-04-13)

Bug fixes

Help

Other

fixest 0.4.0 (2020-03-27)

User visible changes: Latexexport

User visible changes:coefplot

New methods

Other

fixest 0.3.1 (2020-02-09)

Major bug fix

Other bug fixes

New features

fixest 0.3.0 (2020-02-01)

New feature: Lagging

New feature: Interactions

New feature:coefplot

New functions

User visible changes

Bug correction

fixest 0.2.1 (2019-11-22)

Major bug correction

Major user visible changes

fixest 0.2.0 (2019-11-19)

New function

-[did_means] New functiondid_means to convenientlycompare means of groups of observations (both treat/control andpre/post). Contains tools to easily export in Latex.

Major user visible changes

Minor user visible changes

Bug correction

Error handling

fixest 0.1.2 (2019-10-04)

Major bug correction

fixest 0.1.1 (2019-09-20)

Major bug correction

Minor bug correction

Error handling

fixest 0.1.0 (2019-09-03)

First version


[8]ページ先頭

©2009-2025 Movatter.jp