library(readxl)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(readr)
library(kableExtra)
##
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
##
## group_rows
options(scipen= 99999999)
library(readxl)
PIB_real <- read_excel("C:/Users/Arturo/Desktop/PIB real.xlsx")
library(mFilter)
lambda_HP<- 100
Colombia_HP <- hpfilter(PIB_real, type = "lambda", freq = lambda_HP)
plot(Colombia_HP, ask = FALSE)
abline(h=0, col="blue")

PIB_potencial<- (Colombia_HP$trend)
Comparacion <- cbind(PIB_real,PIB_potencial)
tabla1 <- data.frame("anios"=1990:2019, Comparacion)
tabla12 <- rename(tabla1, "PIB_REAL"="PIB", "PIB_POTENCIAL"="PIB.1", "Años"="anios")
tabla12 %>%kbl() %>% kable_material_dark()
|
Años
|
PIB_REAL
|
PIB_POTENCIAL
|
|
1990
|
330352934040321
|
333633857372006
|
|
1991
|
336965303464300
|
345580529061447
|
|
1992
|
350595312219100
|
357494391517572
|
|
1993
|
369476307007500
|
369256483251092
|
|
1994
|
390960105089700
|
380678851979733
|
|
1995
|
411299560568600
|
391575743658787
|
|
1996
|
419755281965700
|
401864216774645
|
|
1997
|
434154120867200
|
411658567982795
|
|
1998
|
436627861973400
|
421252004590637
|
|
1999
|
418271960097800
|
431162689434414
|
|
2000
|
430505835553500
|
442062543924198
|
|
2001
|
437729285682800
|
454494582176692
|
|
2002
|
448689941488100
|
468886251224896
|
|
2003
|
466270833399700
|
485497345136868
|
|
2004
|
491137159839000
|
504385694883299
|
|
2005
|
514853000000000
|
525416866317508
|
|
2006
|
549435000000000
|
548323939942373
|
|
2007
|
586457000000000
|
572734357597593
|
|
2008
|
605713000000000
|
598286671723448
|
|
2009
|
612616000000000
|
624756661184238
|
|
2010
|
640151000000000
|
651994368127030
|
|
2011
|
684628000000000
|
679728428087050
|
|
2012
|
711415000000000
|
707569042918252
|
|
2013
|
747939000000000
|
735175410193720
|
|
2014
|
781589000000000
|
762245187057354
|
|
2015
|
804692000000000
|
788603666551121
|
|
2016
|
821489000000000
|
814269579846409
|
|
2017
|
832656000000000
|
839422541449100
|
|
2018
|
853600000000000
|
864314360066608
|
|
2019
|
881429209766022
|
889129178991857
|