diff --git a/DESCRIPTION b/DESCRIPTION index 82e6e3b..20c6552 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: capybara Type: Package Title: Fast and Memory Efficient Fitting of Linear Models With High-Dimensional Fixed Effects -Version: 0.4 +Version: 0.4.5 Authors@R: c( person( given = "Mauricio", diff --git a/R/fixed_effects.R b/R/fixed_effects.R index 0d21d9e..ffcbd07 100644 --- a/R/fixed_effects.R +++ b/R/fixed_effects.R @@ -14,6 +14,14 @@ #' @references Gaure, S. (n. d.). "Multicollinearity, identification, and #' estimable functions". Unpublished. #' @seealso \code{\link{felm}}, \code{\link{feglm}} +#' @examples +#' # same as the example in feglm but extracting the fixed effects +#' mod <- fepoisson( +#' trade ~ log_dist + lang + cntg + clny | exp_year + imp_year, +#' trade_panel +#' ) +#' +#' fixed_effects(mod) #' @export fixed_effects <- function(object = NULL, alpha.tol = 1.0e-08) { # Check validity of 'object' @@ -51,8 +59,8 @@ fixed_effects <- function(object = NULL, alpha.tol = 1.0e-08) { # Assign names to the different fixed effects categories for (i in seq.int(k)) { - fe.list[[i]] <- as.vector(fe.list[[i]]) - names(fe.list[[i]]) <- nms.fe[[i]] + colnames(fe.list[[i]]) <- k.vars[i] + rownames(fe.list[[i]]) <- nms.fe[[i]] } names(fe.list) <- k.vars diff --git a/dev/cass_bug.r b/dev/cass_bug.r new file mode 100644 index 0000000..b9b6af5 --- /dev/null +++ b/dev/cass_bug.r @@ -0,0 +1,58 @@ +library(tidyverse) +# library(alpaca) +# library(capybara) +library(devtools) + +load_all() + +# trade <- capybara::trade_panel %>% +trade <- trade_panel %>% + mutate( + exporter = str_sub(exp_year, 1, 3), + importer = str_sub(imp_year, 1, 3), + pair_id_2 = ifelse(exporter == importer, "0-intra", pair), + + # Set reference country + exporter = ifelse(exporter == "DEU", "0-DEU", exporter), + importer = ifelse(importer == "DEU", "0-DEU", importer) + ) %>% + # Sort by importer + arrange(importer) %>% + # Compute sum of trade by pair + group_by(pair) %>% + mutate(sum_trade = sum(trade)) %>% + ungroup() + +# Poisson regression with Capybara works fine +# fit_capybara <- capybara::fepoisson( +object <- fepoisson( + trade ~ rta | exp_year + imp_year + pair_id_2, + data = trade %>% filter(sum_trade > 0) +) + +foo <- fixed_effects(object) + +class(foo) +class(foo$exp_year) + +head(foo$exp_year) + +summary(object) + +# Error when using fixed_effects() +options(error = function() traceback(3)) +foo <- fixed_effects(object) +bar <- alpaca::getFEs(object) + +names(foo) +head(foo$exp_year) +head(bar$exp_year) + +all.equal(foo$exp_year, bar$exp_year) +all.equal(foo$imp_year, bar$imp_year) +all.equal(foo$pair_id_2, bar$pair_id_2) + +saveRDS( + list(model = object, fes = foo), + "dev/cass_bug.rds" +) diff --git a/dev/cass_bug.txt b/dev/cass_bug.txt new file mode 100644 index 0000000..b7ceb21 --- /dev/null +++ b/dev/cass_bug.txt @@ -0,0 +1,173 @@ +==37800== Memcheck, a memory error detector +==37800== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. +==37800== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info +==37800== Command: /usr/lib/R/bin/exec/R --vanilla -f dev/cass_bug.r +==37800== + +R version 4.3.3 (2024-02-29) -- "Angel Food Cake" +Copyright (C) 2024 The R Foundation for Statistical Computing +Platform: x86_64-pc-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> library(tidyverse) +── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── +✔ dplyr 1.1.4 ✔ readr 2.1.5 +✔ forcats 1.0.0 ✔ stringr 1.5.1 +✔ ggplot2 3.4.4 ✔ tibble 3.2.1 +✔ lubridate 1.9.3 ✔ tidyr 1.3.1 +✔ purrr 1.0.2 +── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ── +✖ dplyr::filter() masks stats::filter() +✖ dplyr::lag() masks stats::lag() +ℹ Use the conflicted package () to force all conflicts to become errors +> # library(alpaca) +> library(capybara) +> library(devtools) +Loading required package: usethis +> +> load_all() +ℹ Loading capybara +> +> # trade <- capybara::trade_panel %>% +> trade <- trade_panel %>% ++ mutate( ++ exporter = str_sub(exp_year, 1, 3), ++ importer = str_sub(imp_year, 1, 3), ++ pair_id_2 = ifelse(exporter == importer, "0-intra", pair), ++ ++ # Set reference country ++ exporter = ifelse(exporter == "DEU", "0-DEU", exporter), ++ importer = ifelse(importer == "DEU", "0-DEU", importer) ++ ) %>% ++ # Sort by importer ++ arrange(importer) %>% ++ # Compute sum of trade by pair ++ group_by(pair) %>% ++ mutate(sum_trade = sum(trade)) %>% ++ ungroup() +> +> # Poisson regression with Capybara works fine +> # fit_capybara <- capybara::fepoisson( +> object <- fepoisson( ++ trade ~ rta | exp_year + imp_year + pair_id_2, ++ data = trade %>% filter(sum_trade > 0) ++ ) +> +> summary(object) +Formula: trade ~ rta | exp_year + imp_year + pair_id_2 + +Family: Poisson + +Estimates: + +| | Estimate | Std. Error | z value | Pr(>|z|) | +|-----|----------|------------|----------|------------| +| rta | -0.0480 | 0.0020 | -24.0238 | 0.0000 *** | + +Significance codes: *** 99.9%; ** 99%; * 95%; . 90% + +Pseudo R-squared: 0.7455 + +Number of observations: Full 27822; Missing 0; Perfect classification 0 + +Number of Fisher Scoring iterations: 19 +> +> # Error when using fixed_effects() +> options(error = function() traceback(3)) +> fixed_effects(object) +==37800== Invalid read of size 8 +==37800== at 0x49E8986: VECTOR_ELT (in /usr/lib/R/lib/libR.so) +==37800== by 0x16BC5713: cpp11::r_vector::operator[](long) const (list.hpp:30) +==37800== by 0x16BC72D3: cpp11::r_vector::operator[](int) const (r_vector.hpp:588) +==37800== by 0x16BCDF33: get_alpha_(cpp11::matrix, double, cpp11::by_column> const&, cpp11::r_vector const&, double) (02_get_alpha.cpp:37) +==37800== by 0x16BFBED6: _capybara_get_alpha_ (cpp11.cpp:19) +==37800== by 0x49562AD: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x495685C: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49AE367: Rf_eval (in /usr/lib/R/lib/libR.so) +==37800== by 0x49B1377: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49AE0FF: Rf_eval (in /usr/lib/R/lib/libR.so) +==37800== by 0x49AFD85: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49B0BB4: Rf_applyClosure (in /usr/lib/R/lib/libR.so) +==37800== Address 0x98e96c0 is 0 bytes after a block of size 3,360 alloc'd +==37800== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) +==37800== by 0x49F0584: Rf_allocVector3 (in /usr/lib/R/lib/libR.so) +==37800== by 0x4A612D8: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x4993264: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49ADCFF: Rf_eval (in /usr/lib/R/lib/libR.so) +==37800== by 0x49AFD85: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49B0BB4: Rf_applyClosure (in /usr/lib/R/lib/libR.so) +==37800== by 0x49F62C0: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49F66B6: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49F6AA1: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x4993067: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49ADCFF: Rf_eval (in /usr/lib/R/lib/libR.so) +==37800== +Error: Invalid input type, expected 'integer' actual 'NULL' +4: .Call(`_capybara_get_alpha_`, p_r, klist, tol) at cpp11.R#8 +3: get_alpha_(pie, k.list, alpha.tol) +2: as.list(get_alpha_(pie, k.list, alpha.tol)) at fixed_effects.R#50 +1: fixed_effects(object) +> +> # [1,] numeric,414 +> # [2,] numeric,414 +> # [3,] numeric,4637 +> +==37800== +==37800== HEAP SUMMARY: +==37800== in use at exit: 202,220,590 bytes in 31,310 blocks +==37800== total heap usage: 214,439 allocs, 183,129 frees, 699,680,359 bytes allocated +==37800== +==37800== LEAK SUMMARY: +==37800== definitely lost: 0 bytes in 0 blocks +==37800== indirectly lost: 0 bytes in 0 blocks +==37800== possibly lost: 2,688 bytes in 8 blocks +==37800== still reachable: 202,217,902 bytes in 31,302 blocks +==37800== of which reachable via heuristic: +==37800== newarray : 4,264 bytes in 1 blocks +==37800== suppressed: 0 bytes in 0 blocks +==37800== Rerun with --leak-check=full to see details of leaked memory +==37800== +==37800== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) +==37800== +==37800== 1 errors in context 1 of 1: +==37800== Invalid read of size 8 +==37800== at 0x49E8986: VECTOR_ELT (in /usr/lib/R/lib/libR.so) +==37800== by 0x16BC5713: cpp11::r_vector::operator[](long) const (list.hpp:30) +==37800== by 0x16BC72D3: cpp11::r_vector::operator[](int) const (r_vector.hpp:588) +==37800== by 0x16BCDF33: get_alpha_(cpp11::matrix, double, cpp11::by_column> const&, cpp11::r_vector const&, double) (02_get_alpha.cpp:37) +==37800== by 0x16BFBED6: _capybara_get_alpha_ (cpp11.cpp:19) +==37800== by 0x49562AD: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x495685C: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49AE367: Rf_eval (in /usr/lib/R/lib/libR.so) +==37800== by 0x49B1377: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49AE0FF: Rf_eval (in /usr/lib/R/lib/libR.so) +==37800== by 0x49AFD85: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49B0BB4: Rf_applyClosure (in /usr/lib/R/lib/libR.so) +==37800== Address 0x98e96c0 is 0 bytes after a block of size 3,360 alloc'd +==37800== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) +==37800== by 0x49F0584: Rf_allocVector3 (in /usr/lib/R/lib/libR.so) +==37800== by 0x4A612D8: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x4993264: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49ADCFF: Rf_eval (in /usr/lib/R/lib/libR.so) +==37800== by 0x49AFD85: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49B0BB4: Rf_applyClosure (in /usr/lib/R/lib/libR.so) +==37800== by 0x49F62C0: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49F66B6: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49F6AA1: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x4993067: ??? (in /usr/lib/R/lib/libR.so) +==37800== by 0x49ADCFF: Rf_eval (in /usr/lib/R/lib/libR.so) +==37800== +==37800== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/docs/404.html b/docs/404.html index 3eb0fa7..a6c6279 100644 --- a/docs/404.html +++ b/docs/404.html @@ -39,7 +39,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 113fed8..7382950 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -17,7 +17,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/articles/index.html b/docs/articles/index.html index 28ddf05..9258c43 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/articles/intro.html b/docs/articles/intro.html index 3148e22..dafd8cd 100644 --- a/docs/articles/intro.html +++ b/docs/articles/intro.html @@ -40,7 +40,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/authors.html b/docs/authors.html index 330a85c..7c58227 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ capybara - 0.4 + 0.4.5 @@ -74,14 +74,14 @@

Citation

Vargas Sepulveda M (2024). capybara: Fast and Memory Efficient Fitting of Linear Models With High-Dimensional Fixed Effects. -R package version 0.4, https://github.com/pachadotdev/capybara, https://pacha.dev/capybara/. +R package version 0.4.5, https://github.com/pachadotdev/capybara, https://pacha.dev/capybara/.

@Manual{,
   title = {capybara: Fast and Memory Efficient Fitting of Linear Models With High-Dimensional
 Fixed Effects},
   author = {Mauricio {Vargas Sepulveda}},
   year = {2024},
-  note = {R package version 0.4, https://github.com/pachadotdev/capybara},
+  note = {R package version 0.4.5, https://github.com/pachadotdev/capybara},
   url = {https://pacha.dev/capybara/},
 }
diff --git a/docs/index.html b/docs/index.html index 5980396..fc25d5a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -46,7 +46,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/news/index.html b/docs/news/index.html index ad13881..9e9f899 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 1816b77..8b1ca45 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,5 +3,5 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: intro: intro.html -last_built: 2024-03-17T19:47Z +last_built: 2024-04-09T14:22Z diff --git a/docs/reference/apes.html b/docs/reference/apes.html index 11a9e61..b4fddc2 100644 --- a/docs/reference/apes.html +++ b/docs/reference/apes.html @@ -26,7 +26,7 @@ capybara - 0.4 + 0.4.5 @@ -186,7 +186,7 @@

Examples

mod_bc <- bias_corr(mod) summary(mod_bc) #> Formula: trade ~ lang | year -#> <environment: 0x59a470a1d000> +#> <environment: 0x5d4a5cb08d18> #> #> Family: Binomial #> diff --git a/docs/reference/bias_corr.html b/docs/reference/bias_corr.html index bc1d8e7..2f1660f 100644 --- a/docs/reference/bias_corr.html +++ b/docs/reference/bias_corr.html @@ -24,7 +24,7 @@ capybara - 0.4 + 0.4.5 @@ -146,7 +146,7 @@

Examples

mod_bc <- bias_corr(mod) summary(mod_bc) #> Formula: trade ~ lang | year -#> <environment: 0x59a4700a1fb0> +#> <environment: 0x5d4a5c181d18> #> #> Family: Binomial #> diff --git a/docs/reference/capybara-package.html b/docs/reference/capybara-package.html index e6d966b..ac84b08 100644 --- a/docs/reference/capybara-package.html +++ b/docs/reference/capybara-package.html @@ -26,7 +26,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/feglm.html b/docs/reference/feglm.html index 86b2cb8..e095cb5 100644 --- a/docs/reference/feglm.html +++ b/docs/reference/feglm.html @@ -22,7 +22,7 @@ capybara - 0.4 + 0.4.5 @@ -162,7 +162,7 @@

Examples

summary(mod) #> Formula: trade ~ log_dist + lang + cntg + clny | exp_year + imp_year -#> <environment: 0x59a470bc7758> +#> <environment: 0x5d4a5ccacc70> #> #> Family: Poisson #> diff --git a/docs/reference/feglm_control.html b/docs/reference/feglm_control.html index 15a0d2a..719640c 100644 --- a/docs/reference/feglm_control.html +++ b/docs/reference/feglm_control.html @@ -18,7 +18,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/felm.html b/docs/reference/felm.html index 363ba35..dbaec4c 100644 --- a/docs/reference/felm.html +++ b/docs/reference/felm.html @@ -18,7 +18,7 @@ capybara - 0.4 + 0.4.5 @@ -116,7 +116,7 @@

Examples

summary(mod) #> Formula: log(trade) ~ log_dist + lang + cntg + clny | exp_year + imp_year -#> <environment: 0x59a4711a9c38> +#> <environment: 0x5d4a5d28d110> #> #> Estimates: #> diff --git a/docs/reference/fenegbin.html b/docs/reference/fenegbin.html index b676a2b..64cda24 100644 --- a/docs/reference/fenegbin.html +++ b/docs/reference/fenegbin.html @@ -19,7 +19,7 @@ capybara - 0.4 + 0.4.5 @@ -135,7 +135,7 @@

Examples

summary(mod) #> Formula: trade ~ log_dist + lang + cntg + clny | exp_year + imp_year -#> <environment: 0x59a4719f1968> +#> <environment: 0x5d4a5dae1918> #> #> Family: Negative Binomial(1.1839) #> diff --git a/docs/reference/fepoisson.html b/docs/reference/fepoisson.html index ac7bc4f..ee3e2a9 100644 --- a/docs/reference/fepoisson.html +++ b/docs/reference/fepoisson.html @@ -18,7 +18,7 @@ capybara - 0.4 + 0.4.5 @@ -122,7 +122,7 @@

Examples

summary(mod) #> Formula: trade ~ log_dist + lang + cntg + clny | exp_year + imp_year -#> <environment: 0x59a46fc7f578> +#> <environment: 0x5d4a5b8ab5e8> #> #> Family: Poisson #> diff --git a/docs/reference/fixed_effects.html b/docs/reference/fixed_effects.html index 9578750..401755b 100644 --- a/docs/reference/fixed_effects.html +++ b/docs/reference/fixed_effects.html @@ -20,7 +20,7 @@ capybara - 0.4 + 0.4.5 @@ -103,6 +103,851 @@

See also

+
+

Examples

+
# same as the example in feglm but extracting the fixed effects
+mod <- fepoisson(
+  trade ~ log_dist + lang + cntg + clny | exp_year + imp_year,
+  trade_panel
+)
+
+fixed_effects(mod)
+#> $exp_year
+#>          exp_year
+#> ARG1986 10.194570
+#> ARG1990 11.080762
+#> ARG1994 11.260244
+#> ARG1998 11.725664
+#> ARG2002 11.677584
+#> ARG2006 12.369637
+#> AUS1986 11.121551
+#> AUS1990 11.899481
+#> AUS1994 12.129521
+#> AUS1998 12.340085
+#> AUS2002 12.378942
+#> AUS2006 13.046079
+#> AUT1986 10.459515
+#> AUT1990 11.185310
+#> AUT1994 11.427700
+#> AUT1998 11.643019
+#> AUT2002 11.746758
+#> AUT2006 12.418536
+#> BEL1986 11.390870
+#> BEL1990 11.866302
+#> BEL1994 12.112611
+#> BEL1998 12.358946
+#> BEL2002 12.504400
+#> BEL2006 13.116175
+#> BGR1986  7.878408
+#> BGR1990  8.345703
+#> BGR1994  9.122975
+#> BGR1998  9.283602
+#> BGR2002  9.571591
+#> BGR2006 10.635233
+#> BOL1986  6.941373
+#> BOL1990  7.684730
+#> BOL1994  8.286135
+#> BOL1998  8.430375
+#> BOL2002  8.187498
+#> BOL2006  8.727339
+#> BRA1986 11.685655
+#> BRA1990 12.172949
+#> BRA1994 12.468183
+#> BRA1998 12.624859
+#> BRA2002 12.737685
+#> BRA2006 13.584045
+#> CAN1986 11.839619
+#> CAN1990 12.496357
+#> CAN1994 12.791215
+#> CAN1998 13.073145
+#> CAN2002 13.071416
+#> CAN2006 13.588790
+#> CHE1986 10.880611
+#> CHE1990 11.426190
+#> CHE1994 11.683030
+#> CHE1998 11.887745
+#> CHE2002 11.915106
+#> CHE2006 12.486894
+#> CHL1986  9.979940
+#> CHL1990 10.774221
+#> CHL1994 10.885047
+#> CHL1998 11.155505
+#> CHL2002 11.368859
+#> CHL2006 12.606934
+#> CHN1986 11.603271
+#> CHN1990 12.482635
+#> CHN1994 13.318700
+#> CHN1998 13.935272
+#> CHN2002 14.423895
+#> CHN2006 15.579432
+#> CMR1986  7.373927
+#> CMR1990  7.740104
+#> CMR1994  7.643529
+#> CMR1998  7.982727
+#> CMR2002  7.855242
+#> CMR2006  8.723032
+#> COL1986  8.451538
+#> COL1990  9.244788
+#> COL1994  9.624692
+#> COL1998  9.733441
+#> COL2002 10.028423
+#> COL2006 10.896674
+#> CRI1986  7.111381
+#> CRI1990  7.772948
+#> CRI1994  8.489445
+#> CRI1998  9.505876
+#> CRI2002  9.807127
+#> CRI2006 10.669368
+#> CYP1986  6.745524
+#> CYP1990  7.446657
+#> CYP1994  7.273826
+#> CYP1998  7.536432
+#> CYP2002  7.551135
+#> CYP2006  9.364471
+#> DEU1986 13.146867
+#> DEU1990 13.600553
+#> DEU1994 13.740104
+#> DEU1998 13.998791
+#> DEU2002 14.076221
+#> DEU2006 14.736030
+#> DNK1986 10.581650
+#> DNK1990 11.022338
+#> DNK1994 11.245983
+#> DNK1998 11.428976
+#> DNK2002 11.523849
+#> DNK2006 12.081372
+#> ECU1986  8.242786
+#> ECU1990  7.817239
+#> ECU1994  8.470794
+#> ECU1998  8.752303
+#> ECU2002  8.850390
+#> ECU2006  9.694517
+#> EGY1986  7.986929
+#> EGY1990  8.645534
+#> EGY1994  9.323381
+#> EGY1998  9.326094
+#> EGY2002  9.605870
+#> EGY2006 10.577844
+#> ESP1986 11.287140
+#> ESP1990 11.940769
+#> ESP1994 12.346671
+#> ESP1998 12.781914
+#> ESP2002 12.852218
+#> ESP2006 13.504160
+#> FIN1986 10.697213
+#> FIN1990 11.272613
+#> FIN1994 11.534895
+#> FIN1998 11.845290
+#> FIN2002 11.799604
+#> FIN2006 12.430958
+#> FRA1986 12.363664
+#> FRA1990 12.868431
+#> FRA1994 13.124783
+#> FRA1998 13.408866
+#> FRA2002 13.390408
+#> FRA2006 13.934917
+#> GBR1986 12.374286
+#> GBR1990 12.919244
+#> GBR1994 13.155353
+#> GBR1998 13.496260
+#> GBR2002 13.452019
+#> GBR2006 13.968273
+#> GRC1986  9.674865
+#> GRC1990  9.996031
+#> GRC1994 10.152244
+#> GRC1998 10.280633
+#> GRC2002 10.211723
+#> GRC2006 11.040912
+#> HKG1986 11.547001
+#> HKG1990 11.980942
+#> HKG1994 12.002152
+#> HKG1998 12.100837
+#> HKG2002 11.831753
+#> HKG2006 12.154525
+#> HUN1986  8.996913
+#> HUN1990  9.635102
+#> HUN1994 10.079391
+#> HUN1998 11.051858
+#> HUN2002 11.433948
+#> HUN2006 12.127311
+#> IDN1986 10.476574
+#> IDN1990 11.203760
+#> IDN1994 11.885790
+#> IDN1998 12.278206
+#> IDN2002 12.441759
+#> IDN2006 13.062040
+#> IND1986 10.393240
+#> IND1990 11.050181
+#> IND1994 11.611829
+#> IND1998 11.968395
+#> IND2002 12.263769
+#> IND2006 13.215194
+#> IRL1986 10.175802
+#> IRL1990 10.803808
+#> IRL1994 11.265465
+#> IRL1998 11.923987
+#> IRL2002 12.316018
+#> IRL2006 12.751194
+#> IRN1986  8.096198
+#> IRN1990  8.669165
+#> IRN1994  9.270084
+#> IRN1998  9.164900
+#> IRN2002  9.260773
+#> IRN2006 10.333825
+#> ISL1986  7.389081
+#> ISL1990  7.580368
+#> ISL1994  7.990900
+#> ISL1998  8.366657
+#> ISL2002  8.540511
+#> ISL2006  9.079546
+#> ISR1986 10.054637
+#> ISR1990 10.689089
+#> ISR1994 11.084532
+#> ISR1998 11.500090
+#> ISR2002 11.638502
+#> ISR2006 12.185468
+#> ITA1986 12.457316
+#> ITA1990 12.950921
+#> ITA1994 13.178095
+#> ITA1998 13.437058
+#> ITA2002 13.415443
+#> ITA2006 13.995671
+#> JOR1986  6.938704
+#> JOR1990  7.200078
+#> JOR1994  7.043325
+#> JOR1998  7.536722
+#> JOR2002  8.069848
+#> JOR2006  9.161185
+#> JPN1986 14.171806
+#> JPN1990 14.458075
+#> JPN1994 14.747132
+#> JPN1998 14.802500
+#> JPN2002 14.738523
+#> JPN2006 15.219174
+#> KEN1986  7.056126
+#> KEN1990  7.253259
+#> KEN1994  8.036683
+#> KEN1998  8.109031
+#> KEN2002  7.904642
+#> KEN2006  8.750146
+#> KOR1986 11.915406
+#> KOR1990 12.505053
+#> KOR1994 12.910049
+#> KOR1998 13.328198
+#> KOR2002 13.480088
+#> KOR2006 14.310913
+#> KWT1986  9.479416
+#> KWT1990  9.340690
+#> KWT1994  9.301886
+#> KWT1998  9.624393
+#> KWT2002  9.811576
+#> KWT2006 10.700194
+#> LKA1986  8.135258
+#> LKA1990  8.537709
+#> LKA1994  9.478873
+#> LKA1998 10.035121
+#> LKA2002  9.909354
+#> LKA2006 10.466987
+#> MAC1986  7.834613
+#> MAC1990  7.581266
+#> MAC1994  7.904154
+#> MAC1998  8.175584
+#> MAC2002  8.144992
+#> MAC2006  8.376552
+#> MAR1986  8.564302
+#> MAR1990  9.142454
+#> MAR1994  9.418905
+#> MAR1998  9.849080
+#> MAR2002  9.992173
+#> MAR2006 10.621089
+#> MEX1986 10.521690
+#> MEX1990 11.213194
+#> MEX1994 12.105710
+#> MEX1998 12.830128
+#> MEX2002 13.037087
+#> MEX2006 13.622461
+#> MLT1986  7.051232
+#> MLT1990  7.981106
+#> MLT1994  8.581060
+#> MLT1998  8.773782
+#> MLT2002  8.903563
+#> MLT2006  9.418827
+#> MMR1986  6.439379
+#> MMR1990  6.791776
+#> MMR1994  7.346060
+#> MMR1998  7.834216
+#> MMR2002  8.527460
+#> MMR2006  8.406701
+#> MUS1986  8.223511
+#> MUS1990  8.773245
+#> MUS1994  9.094376
+#> MUS1998  9.363311
+#> MUS2002  9.253998
+#> MUS2006  9.502233
+#> MWI1986  5.973637
+#> MWI1990  5.696469
+#> MWI1994  6.020052
+#> MWI1998  7.745218
+#> MWI2002  7.627025
+#> MWI2006  7.902887
+#> MYS1986 10.654494
+#> MYS1990 11.423959
+#> MYS1994 12.269026
+#> MYS1998 12.745324
+#> MYS2002 12.949191
+#> MYS2006 13.533902
+#> NER1986  7.220961
+#> NER1990  7.238342
+#> NER1994  6.446725
+#> NER1998  6.349961
+#> NER2002  6.176657
+#> NER2006  7.285880
+#> NGA1986  7.130746
+#> NGA1990  8.192647
+#> NGA1994  8.395750
+#> NGA1998  8.543377
+#> NGA2002  8.615136
+#> NGA2006 10.146535
+#> NLD1986 11.605338
+#> NLD1990 12.096577
+#> NLD1994 12.256530
+#> NLD1998 12.519676
+#> NLD2002 12.566005
+#> NLD2006 13.302181
+#> NOR1986 10.140664
+#> NOR1990 10.711725
+#> NOR1994 10.764396
+#> NOR1998 11.037391
+#> NOR2002 10.989473
+#> NOR2006 11.734851
+#> NPL1986  6.402975
+#> NPL1990  6.908475
+#> NPL1994  7.644572
+#> NPL1998  7.726996
+#> NPL2002  7.933806
+#> NPL2006  8.052570
+#> PAN1986  8.068681
+#> PAN1990  8.889641
+#> PAN1994  9.091118
+#> PAN1998  8.488277
+#> PAN2002  8.572363
+#> PAN2006  9.041154
+#> PHL1986  9.888340
+#> PHL1990 10.261418
+#> PHL1994 10.829918
+#> PHL1998 12.031662
+#> PHL2002 12.189400
+#> PHL2006 12.709956
+#> POL1986  8.781312
+#> POL1990  9.613813
+#> POL1994 10.506606
+#> POL1998 11.021573
+#> POL2002 11.440996
+#> POL2006 12.453975
+#> PRT1986 10.124760
+#> PRT1990 10.795941
+#> PRT1994 11.032268
+#> PRT1998 11.359753
+#> PRT2002 11.366078
+#> PRT2006 11.902777
+#> QAT1986  7.113503
+#> QAT1990  7.888711
+#> QAT1994  8.290076
+#> QAT1998  8.237837
+#> QAT2002  8.673555
+#> QAT2006 10.021110
+#> ROM1986  9.665970
+#> ROM1990  9.436696
+#> ROM1994  9.792212
+#> ROM1998 10.154425
+#> ROM2002 10.635502
+#> ROM2006 11.518529
+#> SEN1986  7.117117
+#> SEN1990  7.637774
+#> SEN1994  7.351602
+#> SEN1998  7.335002
+#> SEN2002  7.521024
+#> SEN2006  7.345368
+#> SGP1986 11.522434
+#> SGP1990 12.298584
+#> SGP1994 12.828444
+#> SGP1998 13.138329
+#> SGP2002 13.107836
+#> SGP2006 13.943206
+#> SWE1986 11.565446
+#> SWE1990 11.970721
+#> SWE1994 12.151947
+#> SWE1998 12.480708
+#> SWE2002 12.399336
+#> SWE2006 13.045519
+#> THA1986 10.431655
+#> THA1990 11.487506
+#> THA1994 12.183785
+#> THA1998 12.588790
+#> THA2002 12.735190
+#> THA2006 13.483842
+#> TTO1986  7.994286
+#> TTO1990  8.300358
+#> TTO1994  8.567056
+#> TTO1998  8.743863
+#> TTO2002  9.103716
+#> TTO2006 10.247330
+#> TUN1986  8.102795
+#> TUN1990  8.544885
+#> TUN1994  9.305567
+#> TUN1998  9.669827
+#> TUN2002  9.754936
+#> TUN2006 10.471429
+#> TUR1986  9.792595
+#> TUR1990 10.384766
+#> TUR1994 10.882346
+#> TUR1998 11.329439
+#> TUR2002 11.658869
+#> TUR2006 12.595327
+#> TZA1986  6.488739
+#> TZA1990  6.648982
+#> TZA1994  6.832942
+#> TZA1998  7.317373
+#> TZA2002  7.745957
+#> TZA2006  8.912844
+#> URY1986  9.086649
+#> URY1990  9.311584
+#> URY1994  9.430917
+#> URY1998  9.632373
+#> URY2002  9.347228
+#> URY2006 10.051517
+#> USA1986 14.156598
+#> USA1990 14.743387
+#> USA1994 15.084010
+#> USA1998 15.436474
+#> USA2002 15.368046
+#> USA2006 15.796046
+#> ZAF1986 11.173609
+#> ZAF1990 11.403263
+#> ZAF1994 11.436332
+#> ZAF1998 11.685390
+#> ZAF2002 11.973881
+#> ZAF2006 12.831377
+#> 
+#> $imp_year
+#>            imp_year
+#> ARG1986  0.22627355
+#> ARG1990 -0.25378646
+#> ARG1994  1.11545624
+#> ARG1998  1.16421953
+#> ARG2002 -0.22298220
+#> ARG2006  0.48908897
+#> AUS1986  2.03731909
+#> AUS1990  1.99230041
+#> AUS1994  1.89088923
+#> AUS1998  1.79870469
+#> AUS2002  1.84987299
+#> AUS2006  1.80852971
+#> AUT1986  0.44546568
+#> AUT1990  0.71154855
+#> AUT1994  0.60727936
+#> AUT1998  0.51648313
+#> AUT2002  0.49009713
+#> AUT2006  0.41119069
+#> BEL1986  1.12502132
+#> BEL1990  1.20804111
+#> BEL1994  1.04509536
+#> BEL1998  1.04691871
+#> BEL2002  1.17119433
+#> BEL2006  1.06666749
+#> BGR1986 -1.19109825
+#> BGR1990 -1.78009823
+#> BGR1994 -1.70965370
+#> BGR1998 -1.81882241
+#> BGR2002 -1.38702388
+#> BGR2006 -0.98509010
+#> BOL1986 -1.55478063
+#> BOL1990 -2.07469293
+#> BOL1994 -1.79245756
+#> BOL1998 -1.45591722
+#> BOL2002 -1.97868471
+#> BOL2006 -1.98843304
+#> BRA1986  1.26560005
+#> BRA1990  1.14587787
+#> BRA1994  1.45879936
+#> BRA1998  1.77415869
+#> BRA2002  1.46715361
+#> BRA2006  1.45355399
+#> CAN1986  2.16943923
+#> CAN1990  2.08191193
+#> CAN1994  2.01117630
+#> CAN1998  1.97197718
+#> CAN2002  2.06434203
+#> CAN2006  1.93732821
+#> CHE1986  0.70825963
+#> CHE1990  0.88672214
+#> CHE1994  0.65039338
+#> CHE1998  0.54759500
+#> CHE2002  0.52168672
+#> CHE2006  0.40657112
+#> CHL1986 -0.06997164
+#> CHL1990  0.20246381
+#> CHL1994  0.40499752
+#> CHL1998  0.50522731
+#> CHL2002  0.27484475
+#> CHL2006  0.48721171
+#> CHN1986  1.46145434
+#> CHN1990  1.41231775
+#> CHN1994  1.88076486
+#> CHN1998  1.83679634
+#> CHN2002  2.43716829
+#> CHN2006  2.73281315
+#> CMR1986 -1.05206893
+#> CMR1990 -1.51542994
+#> CMR1994 -2.53637961
+#> CMR1998 -2.26998776
+#> CMR2002 -2.14926632
+#> CMR2006 -2.45958040
+#> COL1986 -0.16236920
+#> COL1990 -0.33894678
+#> COL1994  0.08627866
+#> COL1998 -0.03498619
+#> COL2002 -0.23504018
+#> COL2006 -0.04035877
+#> CRI1986 -1.52619804
+#> CRI1990 -1.61095636
+#> CRI1994 -1.30602082
+#> CRI1998 -1.00354227
+#> CRI2002 -0.83296697
+#> CRI2006 -0.96903667
+#> CYP1986 -1.36650732
+#> CYP1990 -1.15863186
+#> CYP1994 -1.26255132
+#> CYP1998 -1.33470421
+#> CYP2002 -1.37553024
+#> CYP2006 -1.30893760
+#> DEU1986  2.66248912
+#> DEU1990  2.79385062
+#> DEU1994  2.64165414
+#> DEU1998  2.55584012
+#> DEU2002  2.52566524
+#> DEU2006  2.46829814
+#> DNK1986  0.54361172
+#> DNK1990  0.39319767
+#> DNK1994  0.25199833
+#> DNK1998  0.23276589
+#> DNK2002  0.23418153
+#> DNK2006  0.14383586
+#> ECU1986 -0.78724758
+#> ECU1990 -1.22994643
+#> ECU1994 -0.83261928
+#> ECU1998 -0.82732871
+#> ECU2002 -0.73719810
+#> ECU2006 -0.75190383
+#> EGY1986  0.38036856
+#> EGY1990 -0.02920657
+#> EGY1994 -0.20911795
+#> EGY1998 -0.07966467
+#> EGY2002 -0.48824441
+#> EGY2006 -0.60515467
+#> ESP1986  1.28248492
+#> ESP1990  1.80821627
+#> ESP1994  1.60652122
+#> ESP1998  1.75427819
+#> ESP2002  1.88789077
+#> ESP2006  1.90230379
+#> FIN1986  0.48156933
+#> FIN1990  0.60874672
+#> FIN1994  0.16449857
+#> FIN1998  0.28249778
+#> FIN2002  0.25011025
+#> FIN2006  0.24898786
+#> FRA1986  2.25009791
+#> FRA1990  2.39739209
+#> FRA1994  2.16274310
+#> FRA1998  2.11511330
+#> FRA2002  2.10978858
+#> FRA2006  1.98285804
+#> GBR1986  2.44977181
+#> GBR1990  2.54469155
+#> GBR1994  2.34370071
+#> GBR1998  2.38398543
+#> GBR2002  2.41520519
+#> GBR2006  2.20944316
+#> GRC1986  0.36934220
+#> GRC1990  0.53464188
+#> GRC1994  0.31350177
+#> GRC1998  0.34517229
+#> GRC2002  0.31499815
+#> GRC2006  0.28013347
+#> HKG1986  1.71635104
+#> HKG1990  2.08636904
+#> HKG1994  2.27572035
+#> HKG1998  2.03983315
+#> HKG2002  2.02721874
+#> HKG2006  1.79466032
+#> HUN1986 -0.91230206
+#> HUN1990 -0.88641594
+#> HUN1994 -0.48081699
+#> HUN1998 -0.11767633
+#> HUN2002  0.15454269
+#> HUN2006  0.16182980
+#> IDN1986  0.82916043
+#> IDN1990  1.01575612
+#> IDN1994  1.05353091
+#> IDN1998  0.51936959
+#> IDN2002  0.69381536
+#> IDN2006  0.76701947
+#> IND1986  1.03259684
+#> IND1990  0.68427546
+#> IND1994  0.66406727
+#> IND1998  0.77179236
+#> IND2002  0.83735915
+#> IND2006  1.16272986
+#> IRL1986  0.04516850
+#> IRL1990  0.14437906
+#> IRL1994  0.10621348
+#> IRL1998  0.33758727
+#> IRL2002  0.53118289
+#> IRL2006  0.29884854
+#> IRN1986  0.44480558
+#> IRN1990  0.49732002
+#> IRN1994 -0.20110488
+#> IRN1998 -0.22708788
+#> IRN2002  0.08787086
+#> IRN2006 -0.03671177
+#> ISL1986 -1.69374440
+#> ISL1990 -1.88947627
+#> ISL1994 -2.24808657
+#> ISL1998 -2.00465849
+#> ISL2002 -2.22010442
+#> ISL2006 -1.87092243
+#> ISR1986  0.28645864
+#> ISR1990  0.45730324
+#> ISR1994  0.61142917
+#> ISR1998  0.46142113
+#> ISR2002  0.49232162
+#> ISR2006  0.16657228
+#> ITA1986  2.21041673
+#> ITA1990  2.35986265
+#> ITA1994  2.02780690
+#> ITA1998  2.01404871
+#> ITA2002  2.05213112
+#> ITA2006  1.92325245
+#> JOR1986 -1.19856999
+#> JOR1990 -1.70155671
+#> JOR1994 -1.65417029
+#> JOR1998 -1.80082490
+#> JOR2002 -1.66190152
+#> JOR2006 -1.62237524
+#> JPN1986  2.95271856
+#> JPN1990  3.18767599
+#> JPN1994  3.05839823
+#> JPN1998  2.76335884
+#> JPN2002  2.78642076
+#> JPN2006  2.42979061
+#> KEN1986 -0.92030463
+#> KEN1990 -1.21722157
+#> KEN1994 -1.50969393
+#> KEN1998 -1.49323037
+#> KEN2002 -1.58358924
+#> KEN2006 -1.38752866
+#> KOR1986  1.20194456
+#> KOR1990  1.61323056
+#> KOR1994  1.67258615
+#> KOR1998  1.21281475
+#> KOR2002  1.65245562
+#> KOR2006  1.52694518
+#> KWT1986  0.08072057
+#> KWT1990 -1.06007699
+#> KWT1994 -0.69013684
+#> KWT1998 -0.73661334
+#> KWT2002 -1.05061201
+#> KWT2006 -0.72267207
+#> LKA1986 -0.97460582
+#> LKA1990 -1.11082625
+#> LKA1994 -0.83660068
+#> LKA1998 -1.05624674
+#> LKA2002 -1.09149193
+#> LKA2006 -1.20655005
+#> MAC1986 -2.84456282
+#> MAC1990 -2.69597938
+#> MAC1994 -2.55600176
+#> MAC1998 -2.87805450
+#> MAC2002 -2.73308045
+#> MAC2006 -2.75631116
+#> MAR1986 -0.73771968
+#> MAR1990 -0.57709276
+#> MAR1994 -0.78506592
+#> MAR1998 -0.75578149
+#> MAR2002 -0.71425676
+#> MAR2006 -0.68045235
+#> MEX1986  0.92639013
+#> MEX1990  1.16970501
+#> MEX1994  1.63069002
+#> MEX1998  1.76540024
+#> MEX2002  2.04069289
+#> MEX2006  1.92149583
+#> MLT1986 -2.16697194
+#> MLT1990 -1.77126867
+#> MLT1994 -1.72306127
+#> MLT1998 -1.87759765
+#> MLT2002 -1.78770511
+#> MLT2006 -2.00704404
+#> MMR1986 -2.23907114
+#> MMR1990 -2.15837866
+#> MMR1994 -1.92862796
+#> MMR1998 -1.90204626
+#> MMR2002 -2.09759585
+#> MMR2006 -2.43489925
+#> MUS1986 -1.82702375
+#> MUS1990 -1.39122101
+#> MUS1994 -1.45598941
+#> MUS1998 -1.74098084
+#> MUS2002 -1.84598699
+#> MUS2006 -1.95166265
+#> MWI1986 -2.91685916
+#> MWI1990 -2.40177551
+#> MWI1994 -2.86237496
+#> MWI1998 -3.27744442
+#> MWI2002 -3.12976061
+#> MWI2006 -3.31888682
+#> MYS1986  0.64820712
+#> MYS1990  1.06041808
+#> MYS1994  1.42788887
+#> MYS1998  1.09674965
+#> MYS2002  1.30387243
+#> MYS2006  1.00878782
+#> NER1986 -3.04153750
+#> NER1990 -3.35861246
+#> NER1994 -3.81822497
+#> NER1998 -3.63809716
+#> NER2002 -3.57080568
+#> NER2006 -3.57617953
+#> NGA1986  0.01805873
+#> NGA1990 -0.25947266
+#> NGA1994 -0.76245637
+#> NGA1998 -0.75548250
+#> NGA2002 -0.31395337
+#> NGA2006 -0.17533259
+#> NLD1986  1.39640762
+#> NLD1990  1.49118663
+#> NLD1994  1.32587039
+#> NLD1998  1.29452043
+#> NLD2002  1.26165607
+#> NLD2006  1.25147276
+#> NOR1986  0.78987201
+#> NOR1990  0.49965939
+#> NOR1994  0.32363473
+#> NOR1998  0.36183322
+#> NOR2002  0.22724305
+#> NOR2006  0.20545643
+#> NPL1986 -2.43795864
+#> NPL1990 -2.74766009
+#> NPL1994 -2.58954217
+#> NPL1998 -2.98726061
+#> NPL2002 -3.30719253
+#> NPL2006 -3.29697715
+#> PAN1986 -0.00781734
+#> PAN1990 -0.54660595
+#> PAN1994 -0.20023177
+#> PAN1998 -0.33823736
+#> PAN2002 -0.63081474
+#> PAN2006 -0.41351496
+#> PHL1986 -0.39490162
+#> PHL1990  0.12077468
+#> PHL1994  0.42165839
+#> PHL1998  0.65583535
+#> PHL2002  0.77172550
+#> PHL2006  0.31140009
+#> POL1986 -1.26411628
+#> POL1990 -1.03953580
+#> POL1994 -0.12763050
+#> POL1998  0.39021350
+#> POL2002  0.43674259
+#> POL2006  0.64292957
+#> PRT1986  0.09093348
+#> PRT1990  0.65905583
+#> PRT1994  0.49004847
+#> PRT1998  0.56333288
+#> PRT2002  0.55843248
+#> PRT2006  0.35256094
+#> QAT1986 -1.60097260
+#> QAT1990 -1.79476250
+#> QAT1994 -1.90702480
+#> QAT1998 -1.59554738
+#> QAT2002 -1.38607725
+#> QAT2006 -0.68241087
+#> ROM1986 -1.56944549
+#> ROM1990 -1.28709461
+#> ROM1994 -1.15152990
+#> ROM1998 -0.75347367
+#> ROM2002 -0.41679030
+#> ROM2006  0.01819399
+#> SEN1986 -1.77659218
+#> SEN1990 -1.80177048
+#> SEN1994 -2.47010711
+#> SEN1998 -2.23712973
+#> SEN2002 -2.12304209
+#> SEN2006 -2.02565826
+#> SGP1986  1.45688763
+#> SGP1990  1.89239099
+#> SGP1994  2.06580696
+#> SGP1998  1.71588393
+#> SGP2002  1.69567570
+#> SGP2006  1.61125599
+#> SWE1986  1.25213124
+#> SWE1990  1.28810108
+#> SWE1994  0.97092816
+#> SWE1998  0.96168572
+#> SWE2002  0.88995605
+#> SWE2006  0.82832458
+#> THA1986  0.40037254
+#> THA1990  1.37383604
+#> THA1994  1.48685127
+#> THA1998  0.91363218
+#> THA2002  1.16157970
+#> THA2006  1.05938454
+#> TTO1986 -1.34560990
+#> TTO1990 -2.18850020
+#> TTO1994 -2.51325807
+#> TTO1998 -1.83325746
+#> TTO2002 -1.82153447
+#> TTO2006 -1.88483905
+#> TUN1986 -1.10053156
+#> TUN1990 -0.90932825
+#> TUN1994 -0.96977404
+#> TUN1998 -0.97345866
+#> TUN2002 -0.95059192
+#> TUN2006 -1.13481341
+#> TUR1986  0.36897466
+#> TUR1990  0.54836685
+#> TUR1994  0.30968077
+#> TUR1998  0.78164884
+#> TUR2002  0.69874362
+#> TUR2006  1.01147570
+#> TZA1986 -1.63559054
+#> TZA1990 -1.82063686
+#> TZA1994 -1.97767736
+#> TZA1998 -2.03854252
+#> TZA2002 -2.11352357
+#> TZA2006 -1.95959002
+#> URY1986 -1.42185301
+#> URY1990 -1.64795239
+#> URY1994 -0.93747142
+#> URY1998 -0.95243907
+#> URY2002 -1.79166430
+#> URY2006 -1.60857381
+#> USA1986  4.64141260
+#> USA1990  4.41416548
+#> USA1994  4.44547128
+#> USA1998  4.45227969
+#> USA2002  4.57531746
+#> USA2006  4.31580271
+#> ZAF1986  1.09034598
+#> ZAF1990  0.96916493
+#> ZAF1994  1.00143024
+#> ZAF1998  0.89114774
+#> ZAF2002  0.79785620
+#> ZAF2006  1.06339642
+#> 
+
+
diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html index b46b52d..5217524 100644 --- a/docs/reference/pipe.html +++ b/docs/reference/pipe.html @@ -17,7 +17,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index fbf649b..53e6040 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -24,7 +24,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/summary.apes.html b/docs/reference/summary.apes.html index fd1dc0f..08da35b 100644 --- a/docs/reference/summary.apes.html +++ b/docs/reference/summary.apes.html @@ -18,7 +18,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/summary.feglm.html b/docs/reference/summary.feglm.html index b8428dc..d23f695 100644 --- a/docs/reference/summary.feglm.html +++ b/docs/reference/summary.feglm.html @@ -19,7 +19,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/summary.felm.html b/docs/reference/summary.felm.html index 5076afe..b24b70a 100644 --- a/docs/reference/summary.felm.html +++ b/docs/reference/summary.felm.html @@ -19,7 +19,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/trade_panel.html b/docs/reference/trade_panel.html index 2fbae25..175eaa7 100644 --- a/docs/reference/trade_panel.html +++ b/docs/reference/trade_panel.html @@ -17,7 +17,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/vcov.apes.html b/docs/reference/vcov.apes.html index 296448e..a4693c5 100644 --- a/docs/reference/vcov.apes.html +++ b/docs/reference/vcov.apes.html @@ -18,7 +18,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/vcov.feglm.html b/docs/reference/vcov.feglm.html index 539ac6a..0d8b112 100644 --- a/docs/reference/vcov.feglm.html +++ b/docs/reference/vcov.feglm.html @@ -19,7 +19,7 @@ capybara - 0.4 + 0.4.5 diff --git a/docs/reference/vcov.felm.html b/docs/reference/vcov.felm.html index a8456d1..5d60603 100644 --- a/docs/reference/vcov.felm.html +++ b/docs/reference/vcov.felm.html @@ -19,7 +19,7 @@ capybara - 0.4 + 0.4.5 diff --git a/man/fixed_effects.Rd b/man/fixed_effects.Rd index 4a83b2a..1e625b5 100644 --- a/man/fixed_effects.Rd +++ b/man/fixed_effects.Rd @@ -23,6 +23,15 @@ collinearity into account. If the solution is not unique, an estimable function has to be applied to our solution to get meaningful estimates of the fixed effects. } +\examples{ +# same as the example in feglm but extracting the fixed effects +mod <- fepoisson( + trade ~ log_dist + lang + cntg + clny | exp_year + imp_year, + trade_panel +) + +fixed_effects(mod) +} \references{ Stammann, A. (2018). "Fast and Feasible Estimation of Generalized Linear Models with High-Dimensional k-way Fixed Effects". ArXiv e-prints. diff --git a/src/02_get_alpha.cpp b/src/02_get_alpha.cpp index 7ba9ad2..a40f1a5 100644 --- a/src/02_get_alpha.cpp +++ b/src/02_get_alpha.cpp @@ -15,14 +15,14 @@ Mat y(N, 1); // Generate starting guess - field> Alpha(K); + field> Alpha(K); for (k = 0; k < K; k++) { J = as_cpp(klist[k]).size(); - Alpha(k) = zeros>(J); + Alpha(k) = zeros>(J, 1); } // Start alternating between normal equations - field> Alpha0(size(Alpha)); + field> Alpha0(size(Alpha)); for (iter = 0; iter < 10000; iter++) { // Check user interrupt @@ -51,7 +51,7 @@ } J = as_cpp(klist[k]).size(); - Col alpha = zeros>(J); + Mat alpha = zeros>(J, 1); for (j = 0; j < J; j++) { // Subset the j-th group of category k @@ -88,8 +88,7 @@ // Return alpha writable::list Alpha_r(K); for (k = 0; k < K; k++) { - // Alpha_r[k] = as_doubles_matrix(Alpha(k)); - Alpha_r[k] = as_doubles(Alpha(k)); + Alpha_r[k] = as_doubles_matrix(Alpha(k)); } return Alpha_r;