Comments (3)
Sure, you have two specific objects in the output:
- obsRemoved: vector of observations that were removed,
- fixef_removed: fixed-effect identifiers that were removed because of only 0/1 outcomes (depends on the family).
library(fixest)
base = iris
names(base) = c("y", "x1", "x2", "x3", "species")
base$y[1] = NA
base$y[base$species == "versicolor"] = 0
(res = fepois(y ~ x1 + x2 | species, base))
#> NOTES: 1 observation removed because of NA values (Breakup: LHS: 1, RHS: 0, Fixed-effects: 0).
#> 1 fixed-effect (50 observations) removed because of only zero outcomes.
#> Poisson estimation, Dep. Var.: y
#> Observations: 99
#> Fixed-effects: species: 2
#> Standard-errors: Clustered (species)
#> Estimate Std. Error z value Pr(>|z|)
#> x1 0.089710 0.045578 1.9683 4.9034e-02 *
#> x2 0.124233 0.017720 7.0109 2.3700e-12 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> Log-likelihood: -179.54 Adj. Pseudo-R2: 0.02014
#> BIC: 377.47 Squared Cor.: 0.90493
# Vector of observation IDs removed
head(res$obsRemoved)
#> [1] 1 51 52 53 54 55
# Fixed-effects removed because of only 0 outcomes
res$fixef_removed
#> $species
#> [1] "versicolor"
from fixest.
I got the fixef_removed part. How shall I remove data based on obsRemoved? In my case, it looks like this
> head(res$obsRemoved)
NA NA.1 NA.2 5 NA.3
1 2 3 4 5 6
All the number seems consecutive. And shall I also create a variable like ID in my original data to remove those?
from fixest.
I don't really understand. Maybe the first observations contain NA somewhere?
For me it works as expected:
> base = iris
> names(base) = c("y", "x1", "x2", "x3", "species")
>
> base$y[1] = NA
> base$x1[3] = NA
> base$x2[5] = NA
> base$species[15:17] = NA
>
> est = feols(y ~ x1 + x2 | species, base)
#> NOTE: 6 observations removed because of NA values (Breakup: LHS: 1, RHS: 2, Fixed-effects: 3).
>
> est$obsRemoved
#> [1] 1 3 5 15 16 17
from fixest.
Related Issues (20)
- Reset global options changed in `setFixest_*`? HOT 2
- [feature request] make output compatible with gt HOT 5
- Issue with Handling Special Characters in e.g. Polynomial Expressions in feglm HOT 2
- Customizing Column Order in etable Output After 2SLS HOT 4
- Missing plot in a vignette HOT 1
- Exporting `fixest:::fetch_data` HOT 2
- Feature request: Implementing `fitstat` for `fixest_multi`
- [Documentation] Warning instead of code HOT 1
- Fama-MacBeth regression HOT 1
- [feature request] Add informative error message/crash on nonidentification in twfe HOT 5
- Feature request: CCV and TSCB clustered SE HOT 8
- Triple Diff in Diff event time
- under-identification test for instrumental var HOT 1
- update() to add fixed effects fails if no fixed effects exist originally HOT 2
- a tiny typo HOT 1
- Switching between distributions for p-values HOT 2
- fixef.rm = "singleton" drops smaller number of observations than reghdfe HOT 6
- Update forumula with stepwise function and fixed effects HOT 3
- compare coefficients between different models HOT 6
- CR3 Standard Errors HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fixest.