This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
install.packages('plotrix')
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
install.packages('corrplot')
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
install.packages('stargazer')
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
install.packages('tseries')
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
install.packages('lmtest')
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
install.packages('strucchange')
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
library(plotrix)
library(corrplot)
## corrplot 0.92 loaded
library(stargazer)
##
## Please cite as:
## Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
## R package version 5.2.3. https://CRAN.R-project.org/package=stargazer
library(tseries)
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
library(lmtest)
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
library(strucchange)
## Loading required package: sandwich
base1 <- read.csv("base_trabajo.csv")
attach(base1)
## The following object is masked from package:datasets:
##
## lh
base1
## X pib ik h h2 n ev dp
## 1 1970 5385.819 3481.082 1.732690 6.451879 3.333438 63.71300 0.4285714
## 2 1971 5412.763 3263.558 1.750521 5.290870 3.263850 64.26900 0.4285714
## 3 1972 5672.384 3524.436 1.768535 5.666480 3.200299 64.87300 0.4285714
## 4 1973 5925.774 3904.378 1.786734 6.109517 3.157102 65.51200 0.5714286
## 5 1974 6076.344 4434.293 1.805120 7.468320 3.182517 66.17700 0.5714286
## 6 1975 6237.066 4393.911 1.823696 8.766240 3.240072 66.85400 0.5714286
## 7 1976 6330.451 4281.866 1.842463 9.562760 2.896650 67.53000 0.5714286
## 8 1977 6369.925 3913.504 1.861423 9.450100 3.125731 68.19100 0.5714286
## 9 1978 6762.484 4323.641 1.880578 10.600690 3.227030 68.82500 0.5714286
## 10 1979 7235.333 4845.245 1.899930 11.729610 3.170322 69.42200 0.5714286
## 11 1980 7715.244 5300.305 1.919481 13.092150 3.065898 69.97400 0.7142857
## 12 1981 8199.231 5889.383 1.944144 13.892110 3.338732 70.47900 0.7142857
## 13 1982 7967.029 4311.096 1.969123 14.505320 3.094501 70.94300 0.7142857
## 14 1983 7468.730 3033.577 1.994423 14.781580 2.991851 71.37300 0.7142857
## 15 1984 7576.608 3121.530 2.020048 15.270400 3.072024 71.77300 0.7142857
## 16 1985 7614.332 3371.509 2.046003 16.778045 3.215418 72.14800 0.5714286
## 17 1986 7182.415 2630.345 2.072291 15.823620 3.258707 72.50300 0.5714286
## 18 1987 7173.127 2691.190 2.098917 15.581390 3.318744 72.84500 0.5714286
## 19 1988 7122.595 2909.676 2.125884 16.211260 3.333217 73.17800 0.7142857
## 20 1989 7278.509 2862.332 2.153199 15.622650 3.255239 73.50600 0.5714286
## 21 1990 7498.684 3096.036 2.180864 15.045820 3.130642 73.83100 0.5714286
## 22 1991 7661.486 3304.373 2.203467 14.331010 3.012343 74.15300 0.5714286
## 23 1992 7782.472 3636.442 2.226304 20.857157 2.967455 74.47000 0.5714286
## 24 1993 7940.144 3108.796 2.249378 13.051180 2.871638 74.77800 0.5714286
## 25 1994 8174.692 3463.305 2.272691 13.234890 2.730519 75.07900 0.5714286
## 26 1995 7522.222 2320.980 2.296246 13.604870 2.567926 75.37400 0.5714286
## 27 1996 7893.907 2624.286 2.320045 14.588710 2.378074 75.66500 0.5714286
## 28 1997 8296.166 2929.488 2.344090 15.395580 2.206472 75.95100 0.7142857
## 29 1998 8588.638 3165.345 2.368385 16.597179 2.066596 76.23300 0.7142857
## 30 1999 8694.987 3193.920 2.392931 17.753180 1.976547 76.50700 0.7142857
## 31 2000 8997.434 3437.774 2.417732 19.050619 1.920359 76.76800 0.8571429
## 32 2001 8843.901 2958.042 2.437087 19.952690 1.853730 77.01200 0.8571429
## 33 2002 8731.220 2887.756 2.456598 21.017090 1.802172 77.23500 0.8571429
## 34 2003 8749.778 2887.627 2.476264 21.971081 1.790383 77.43600 0.8571429
## 35 2004 8977.658 2979.716 2.496088 22.846491 1.820222 77.61500 0.8571429
## 36 2005 9059.810 3154.592 2.516070 23.411720 1.883247 77.77700 0.8571429
## 37 2006 9327.736 3358.504 2.536212 23.869680 2.154859 77.92700 0.8571429
## 38 2007 9392.687 3451.348 2.556516 24.348770 2.221992 78.07100 0.8571429
## 39 2008 9347.524 3548.808 2.571415 24.904791 2.258478 78.21500 0.8571429
## 40 2009 8712.140 3058.763 2.585257 25.322901 2.249266 78.36300 0.8571429
## 41 2010 9016.458 3196.128 2.599173 26.297030 2.196820 78.51800 0.7142857
## 42 2011 9207.729 3331.832 2.618361 27.197121 2.121609 78.68100 0.7142857
## 43 2012 9405.813 3439.287 2.637690 28.513121 2.049084 78.84900 0.7142857
## 44 2013 9400.322 3301.595 2.657163 29.461599 1.969704 79.01900 0.7142857
## 45 2014 9536.600 3297.035 2.676779 30.229780 1.885812 79.19100 0.7142857
## 46 2015 9717.898 3376.766 2.695469 30.794319 1.799375 79.36500 0.7142857
## 47 2016 9871.670 3372.815 2.714290 36.850739 1.644193 79.53800 0.7142857
## 48 2017 9946.158 3266.570 2.733243 39.231844 1.595732 79.71138 0.7142857
## lc democ autoc polity durable dum1 dum2 dum3 dum4 dum5 dum6 lpib
## 1 0.7142857 0 6 -6 40 0 0 0 0 0 0 3.731252
## 2 0.7142857 0 6 -6 41 0 0 0 0 0 0 3.733419
## 3 0.7142857 0 6 -6 42 0 0 0 0 0 0 3.753766
## 4 0.7142857 0 6 -6 43 0 0 0 0 0 0 3.772745
## 5 0.7142857 0 6 -6 44 0 0 0 0 0 0 3.783642
## 6 0.7142857 0 6 -6 45 0 0 0 0 0 0 3.794980
## 7 0.5714286 0 6 -6 46 0 1 0 0 0 1 3.801435
## 8 0.7142857 1 4 -3 0 0 0 0 0 0 0 3.804134
## 9 0.5714286 1 4 -3 1 0 0 0 0 1 0 3.830106
## 10 0.5714286 1 4 -3 2 0 0 0 0 1 0 3.859459
## 11 0.5714286 1 4 -3 3 0 0 0 0 1 0 3.887350
## 12 0.5714286 1 4 -3 4 0 0 0 0 1 0 3.913773
## 13 0.5714286 1 4 -3 5 0 0 0 0 1 0 3.901296
## 14 0.5714286 1 4 -3 6 1 0 0 0 1 0 3.873247
## 15 0.5714286 1 4 -3 7 1 0 0 0 1 0 3.879475
## 16 0.5714286 1 4 -3 8 1 0 0 0 1 0 3.881632
## 17 0.5714286 1 4 -3 9 1 0 0 0 1 0 3.856271
## 18 0.5714286 1 4 -3 10 1 0 0 0 1 0 3.855709
## 19 0.5714286 2 2 0 0 1 1 0 1 1 0 3.852638
## 20 0.7142857 2 2 0 1 1 0 0 1 1 0 3.862042
## 21 0.5714286 2 2 0 2 1 0 0 1 1 0 3.874985
## 22 0.5714286 2 2 0 3 1 0 0 1 1 0 3.884313
## 23 0.7142857 2 2 0 4 1 0 0 1 1 0 3.891118
## 24 0.5714286 2 2 0 5 1 0 0 1 1 0 3.899828
## 25 0.5714286 4 0 4 0 1 0 0 1 1 0 3.912471
## 26 0.5714286 4 0 4 0 1 0 0 1 1 0 3.876346
## 27 0.7142857 4 0 4 0 1 0 0 1 1 0 3.897292
## 28 0.5714286 6 0 6 0 1 0 0 1 1 0 3.918877
## 29 0.5714286 6 0 6 1 1 0 0 1 1 0 3.933924
## 30 0.5714286 6 0 6 2 1 0 0 1 1 0 3.939269
## 31 0.7142857 8 0 8 3 1 0 0 1 1 0 3.954119
## 32 0.7142857 8 0 8 4 1 0 0 1 1 0 3.946644
## 33 0.8571429 8 0 8 5 1 0 0 1 1 0 3.941075
## 34 0.8571429 8 0 8 6 1 0 0 1 1 0 3.941997
## 35 0.8571429 8 0 8 7 1 0 0 1 1 0 3.953163
## 36 0.8571429 8 0 8 8 1 0 0 1 1 0 3.957119
## 37 0.7142857 8 0 8 9 1 0 0 1 1 0 3.969776
## 38 0.7142857 8 0 8 10 1 0 0 1 1 0 3.972790
## 39 0.7142857 8 0 8 11 1 0 0 1 1 0 3.970697
## 40 0.7142857 8 0 8 12 1 0 1 1 1 1 3.940125
## 41 0.7142857 8 0 8 13 1 0 0 1 1 0 3.955036
## 42 0.7142857 8 0 8 14 1 0 0 1 1 0 3.964153
## 43 0.7142857 8 0 8 15 1 0 0 1 1 0 3.973396
## 44 0.7142857 8 0 8 16 1 0 0 1 1 0 3.973143
## 45 0.7142857 8 0 8 17 1 0 0 1 1 0 3.979394
## 46 0.7142857 8 0 8 18 1 0 0 1 1 0 3.987572
## 47 0.7142857 8 0 8 19 1 0 0 1 1 0 3.994391
## 48 0.7142857 8 0 8 20 1 0 0 1 1 0 3.997655
## lk gpib lh gh lag_pib dum_2 dp_dum_1
## 1 3.541714 NA 0.2387210 NA NA 0 0.0000000
## 2 3.513691 0.21672691 0.2431673 0.4446299 3.731252 0 0.0000000
## 3 3.547090 2.03465823 0.2476136 0.4446294 3.733419 0 0.0000000
## 4 3.591552 1.89794434 0.2520599 0.4446294 3.753766 0 0.0000000
## 5 3.646824 1.08972873 0.2565062 0.4446293 3.772745 0 0.0000000
## 6 3.642851 1.13380178 0.2609525 0.4446288 3.783642 0 0.0000000
## 7 3.631633 0.64543160 0.2653987 0.4446273 3.794980 1 0.0000000
## 8 3.592566 0.26996111 0.2698450 0.4446301 3.801435 1 0.0000000
## 9 3.635850 2.59719813 0.2742913 0.4446282 3.804134 0 0.0000000
## 10 3.685316 2.93522617 0.2787376 0.4446295 3.830106 0 0.0000000
## 11 3.724301 2.78911441 0.2831839 0.4446307 3.859459 0 0.0000000
## 12 3.770070 2.64234458 0.2887284 0.5544444 3.887350 0 0.0000000
## 13 3.634588 -1.24767123 0.2942728 0.5544494 3.913773 0 0.0000000
## 14 3.481955 -2.80496296 0.2998173 0.5544461 3.901296 0 0.0000000
## 15 3.494368 0.62280640 0.3053618 0.5544464 3.873247 0 0.0000000
## 16 3.527824 0.21569937 0.3109062 0.5544467 3.879475 0 0.0000000
## 17 3.420013 -2.53613182 0.3164507 0.5544482 3.881632 0 0.0000000
## 18 3.429944 -0.05620083 0.3219952 0.5544449 3.856271 0 0.0000000
## 19 3.463845 -0.30702739 0.3275396 0.5544456 3.855709 0 0.7142857
## 20 3.456720 0.94041736 0.3330841 0.5544489 3.852638 0 0.5714286
## 21 3.490806 1.29426568 0.3386286 0.5544442 3.862042 0 0.5714286
## 22 3.519089 0.93279512 0.3431065 0.4477974 3.874985 0 0.5714286
## 23 3.560677 0.68045636 0.3475845 0.4477948 3.884313 0 0.5714286
## 24 3.492592 0.87108027 0.3520624 0.4477960 3.891118 0 0.5714286
## 25 3.539491 1.26430130 0.3565404 0.4477958 3.899828 0 0.5714286
## 26 3.365671 -3.61252626 0.3610184 0.4477983 3.912471 0 0.5714286
## 27 3.419011 2.09458919 0.3654963 0.4477941 3.876346 0 0.5714286
## 28 3.466792 2.15853971 0.3699743 0.4477961 3.897292 0 0.7142857
## 29 3.500421 1.50468645 0.3744523 0.4477993 3.918877 0 0.7142857
## 30 3.504324 0.53446614 0.3789302 0.4477944 3.933924 0 0.7142857
## 31 3.536277 1.48496991 0.3834082 0.4477942 3.939269 0 0.8571429
## 32 3.471004 -0.74747709 0.3868711 0.3462927 3.954119 0 0.8571429
## 33 3.460560 -0.55689480 0.3903340 0.3462931 3.946644 0 0.8571429
## 34 3.460541 0.09221037 0.3937969 0.3462885 3.941075 0 0.8571429
## 35 3.474175 1.11660125 0.3972598 0.3462912 3.941997 0 0.8571429
## 36 3.498943 0.39560647 0.4007227 0.3462927 3.953163 0 0.8571429
## 37 3.526146 1.26571421 0.4041856 0.3462888 3.957119 0 0.8571429
## 38 3.537989 0.30136002 0.4076485 0.3462915 3.969776 0 0.8571429
## 39 3.550082 -0.20932536 0.4101722 0.2523660 3.972790 0 0.8571429
## 40 3.485546 -3.05717263 0.4125037 0.2331487 3.970697 1 0.8571429
## 41 3.504624 1.49110850 0.4148352 0.2331467 3.940125 0 0.7142857
## 42 3.522683 0.91165832 0.4180295 0.3194325 3.955036 0 0.7142857
## 43 3.536468 0.92438041 0.4212238 0.3194320 3.964153 0 0.7142857
## 44 3.518724 -0.02536120 0.4244181 0.3194339 3.973396 0 0.7142857
## 45 3.518123 0.62508514 0.4276125 0.3194341 3.973143 0 0.7142857
## 46 3.528501 0.81787739 0.4306344 0.3021895 3.979394 0 0.7142857
## 47 3.527993 0.68182781 0.4336563 0.3021895 3.987572 0 0.7142857
## 48 3.514092 0.32647200 0.4366782 0.3021895 3.994391 0 0.7142857
twoord.plot(X,pib,X,gpib,ylab="PIB per c?pita",rylab="Tasa de crecimiento del PIB per c?pita",lcol=4,main="Evoluci?n del PIB per c?pita, 1970-2017",type = c('line', 'line'), do.first="plot_bg();grid(col=\"white\",lty=1)")
## Warning in plot.xy(xy.coords(x, y), type = type, ...): plot type 'line' will be
## truncated to first character
## Warning in plot.xy(xy.coords(x, y), type = type, ...): plot type 'line' will be
## truncated to first character
###Tabla de correlacion
base2=data.frame(lpib,lk,h,n,ev,lc,dp,polity,durable)
base2
## lpib lk h n ev lc dp polity
## 1 3.731252 3.541714 1.732690 3.333438 63.71300 0.7142857 0.4285714 -6
## 2 3.733419 3.513691 1.750521 3.263850 64.26900 0.7142857 0.4285714 -6
## 3 3.753766 3.547090 1.768535 3.200299 64.87300 0.7142857 0.4285714 -6
## 4 3.772745 3.591552 1.786734 3.157102 65.51200 0.7142857 0.5714286 -6
## 5 3.783642 3.646824 1.805120 3.182517 66.17700 0.7142857 0.5714286 -6
## 6 3.794980 3.642851 1.823696 3.240072 66.85400 0.7142857 0.5714286 -6
## 7 3.801435 3.631633 1.842463 2.896650 67.53000 0.5714286 0.5714286 -6
## 8 3.804134 3.592566 1.861423 3.125731 68.19100 0.7142857 0.5714286 -3
## 9 3.830106 3.635850 1.880578 3.227030 68.82500 0.5714286 0.5714286 -3
## 10 3.859459 3.685316 1.899930 3.170322 69.42200 0.5714286 0.5714286 -3
## 11 3.887350 3.724301 1.919481 3.065898 69.97400 0.5714286 0.7142857 -3
## 12 3.913773 3.770070 1.944144 3.338732 70.47900 0.5714286 0.7142857 -3
## 13 3.901296 3.634588 1.969123 3.094501 70.94300 0.5714286 0.7142857 -3
## 14 3.873247 3.481955 1.994423 2.991851 71.37300 0.5714286 0.7142857 -3
## 15 3.879475 3.494368 2.020048 3.072024 71.77300 0.5714286 0.7142857 -3
## 16 3.881632 3.527824 2.046003 3.215418 72.14800 0.5714286 0.5714286 -3
## 17 3.856271 3.420013 2.072291 3.258707 72.50300 0.5714286 0.5714286 -3
## 18 3.855709 3.429944 2.098917 3.318744 72.84500 0.5714286 0.5714286 -3
## 19 3.852638 3.463845 2.125884 3.333217 73.17800 0.5714286 0.7142857 0
## 20 3.862042 3.456720 2.153199 3.255239 73.50600 0.7142857 0.5714286 0
## 21 3.874985 3.490806 2.180864 3.130642 73.83100 0.5714286 0.5714286 0
## 22 3.884313 3.519089 2.203467 3.012343 74.15300 0.5714286 0.5714286 0
## 23 3.891118 3.560677 2.226304 2.967455 74.47000 0.7142857 0.5714286 0
## 24 3.899828 3.492592 2.249378 2.871638 74.77800 0.5714286 0.5714286 0
## 25 3.912471 3.539491 2.272691 2.730519 75.07900 0.5714286 0.5714286 4
## 26 3.876346 3.365671 2.296246 2.567926 75.37400 0.5714286 0.5714286 4
## 27 3.897292 3.419011 2.320045 2.378074 75.66500 0.7142857 0.5714286 4
## 28 3.918877 3.466792 2.344090 2.206472 75.95100 0.5714286 0.7142857 6
## 29 3.933924 3.500421 2.368385 2.066596 76.23300 0.5714286 0.7142857 6
## 30 3.939269 3.504324 2.392931 1.976547 76.50700 0.5714286 0.7142857 6
## 31 3.954119 3.536277 2.417732 1.920359 76.76800 0.7142857 0.8571429 8
## 32 3.946644 3.471004 2.437087 1.853730 77.01200 0.7142857 0.8571429 8
## 33 3.941075 3.460560 2.456598 1.802172 77.23500 0.8571429 0.8571429 8
## 34 3.941997 3.460541 2.476264 1.790383 77.43600 0.8571429 0.8571429 8
## 35 3.953163 3.474175 2.496088 1.820222 77.61500 0.8571429 0.8571429 8
## 36 3.957119 3.498943 2.516070 1.883247 77.77700 0.8571429 0.8571429 8
## 37 3.969776 3.526146 2.536212 2.154859 77.92700 0.7142857 0.8571429 8
## 38 3.972790 3.537989 2.556516 2.221992 78.07100 0.7142857 0.8571429 8
## 39 3.970697 3.550082 2.571415 2.258478 78.21500 0.7142857 0.8571429 8
## 40 3.940125 3.485546 2.585257 2.249266 78.36300 0.7142857 0.8571429 8
## 41 3.955036 3.504624 2.599173 2.196820 78.51800 0.7142857 0.7142857 8
## 42 3.964153 3.522683 2.618361 2.121609 78.68100 0.7142857 0.7142857 8
## 43 3.973396 3.536468 2.637690 2.049084 78.84900 0.7142857 0.7142857 8
## 44 3.973143 3.518724 2.657163 1.969704 79.01900 0.7142857 0.7142857 8
## 45 3.979394 3.518123 2.676779 1.885812 79.19100 0.7142857 0.7142857 8
## 46 3.987572 3.528501 2.695469 1.799375 79.36500 0.7142857 0.7142857 8
## 47 3.994391 3.527993 2.714290 1.644193 79.53800 0.7142857 0.7142857 8
## 48 3.997655 3.514092 2.733243 1.595732 79.71138 0.7142857 0.7142857 8
## durable
## 1 40
## 2 41
## 3 42
## 4 43
## 5 44
## 6 45
## 7 46
## 8 0
## 9 1
## 10 2
## 11 3
## 12 4
## 13 5
## 14 6
## 15 7
## 16 8
## 17 9
## 18 10
## 19 0
## 20 1
## 21 2
## 22 3
## 23 4
## 24 5
## 25 0
## 26 0
## 27 0
## 28 0
## 29 1
## 30 2
## 31 3
## 32 4
## 33 5
## 34 6
## 35 7
## 36 8
## 37 9
## 38 10
## 39 11
## 40 12
## 41 13
## 42 14
## 43 15
## 44 16
## 45 17
## 46 18
## 47 19
## 48 20
correlacion<-round(cor(base2), 1)
corrplot(correlacion, method="number", type="upper")