kylebutts/jive

Cannot replicate the example due to ERROR: 'sparse_model_matrix' is not an exported object from 'namespace:fixest'

Closed this issue · 8 comments

Hi, thanks for sharing this wonderful command. I cannot replicate the example in the README. Hope the following info may help:

R version: 4.3.1

packageVersion("fixest")
[1] ‘0.11.1’
packageVersion("jive")
[1] ‘0.0.0.9000’

> data(stevenson)
> 
> jive(
+   guilt ~ i(black) + i(white) | bailDate | jail3 ~ 0 | judge_pre,
+   data = stevenson
+ )
Error: 'sparse_model_matrix' is not an exported object from 'namespace:fixest'```

Hi. This package is waiting on a sparse_model_matrix pull request to be accepted in fixest. You can install a dev version with this by using devtools::install_github("kylebutts/fixest").

Thanks for your kind help! I followed your instructions, but the error still exists.

>devtools::install_github("kylebutts/fixest")
Downloading GitHub repo kylebutts/fixest@HEAD
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file 'C:\Users\user\AppData\Local\Temp\RtmpqWw1O2\remotes61a030d4a42\kylebutts-fixest-b65fe51/DESCRIPTION' ...
─  preparing 'fixest': (3.2s)
✔  checking DESCRIPTION meta-information ... 
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts (559ms)
─  checking for empty or unneeded directories
─  building 'fixest_0.11.1.tar.gz'
   --omit--
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (fixest)
> library(jive)
> data(stevenson)
> jive(
+   guilt ~ i(black) + i(white) | bailDate | jail3 ~ 0 | judge_pre,
+   data = stevenson
+ )
Error: 'sparse_model_matrix' is not an exported object from 'namespace:fixest'

My mistake; you need to specify the correct branch: devtools::install_github("https://github.com/kylebutts/fixest/tree/sparse-matrix")

Many thanks for your reply. The example works now. However, the command throws an error when there are two endogenous variables. I guess the command has not supported more than one endogenous variable yet. For example, when I run the following regression with two endogenous variables.

> library(jive)
> jive(
+   guilt ~ i(black) + i(white) | bailDate | jail3+guilt ~ 0 | judge_pre,
+   data = stevenson
+ )
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'rowSums': error in evaluating the argument 'x' in selecting a method for function 't': non-conformable arguments

All the standard jive papers/results involve only a singular endogenous variable. Could you share any references with multiple endogenous variables and I can try to add support

Thanks for your help on this issue. To be frank, I am unfamiliar with the mathematical techniques behind JIVE, but I notice that the command "JIVE" in Stata supports multiple endogenous variables:

  • Angrist, J. D., G. W. Imbens, and A. B. Krueger. 1999. Jackknife instrumental variables estimation. Journal of Applied Econometrics 14: 57-67.
  • Blomquist, S. and M. Dahlberg. 1999. Small sample properties of LIML and jackknife IV estimators: Experiments with weak instruments. Journal of Applied Econometrics 14: 69-88.

The theory that I know if in this literature is based on a singular endogenous variable (for the variants). I'll open a separate issue to consider this.