gif
library(WDI)
library(wbstats)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.2 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(gplots)
##
## Attaching package: 'gplots'
##
## The following object is masked from 'package:stats':
##
## lowess
library(plm)
##
## Attaching package: 'plm'
##
## The following objects are masked from 'package:dplyr':
##
## between, lag, lead
library(readxl)
#Obtener información de 1 país
gdp_data <- wb_data(country=c("MX", "EC","CA"), indicator = "NY.GDP.PCAP.CD", start_date=2013, end_date=2013)
gdp_data
## # A tibble: 3 × 9
## iso2c iso3c country date NY.GDP.PCAP.CD unit obs_status footnote
## <chr> <chr> <chr> <dbl> <dbl> <chr> <chr> <chr>
## 1 CA CAN Canada 2013 52635. <NA> <NA> <NA>
## 2 EC ECU Ecuador 2013 6050. <NA> <NA> <NA>
## 3 MX MEX Mexico 2013 11317. <NA> <NA> <NA>
## # ℹ 1 more variable: last_updated <date>
#Generar un conjunto de datos de panel
#Generar un conjunto de datos de panel
panel <- select(gdp_data, country, date, NY.GDP.PCAP.CD)
panel_tax <- pdata.frame(panel, index = c("country","date"))
tax_data <- wb_data(country=c("US", "AU","CA","MA"), indicator = c("GC.TAX.TOTL.GD.ZS", "NY.GDP.MKTP.KD.ZG","FP.CPI.TOTL.ZG", "SL.UEM.TOTL.ZS"), start_date=2000, end_date=2023)
panel_tax <- select(tax_data, country, date, GC.TAX.TOTL.GD.ZS, NY.GDP.MKTP.KD.ZG,FP.CPI.TOTL.ZG, SL.UEM.TOTL.ZS)
panel_tax <- subset(panel_tax, date == 2000 | date == 2010 | date == 2020)
panel_tax <- panel_tax[complete.cases(panel_tax[ , c('GC.TAX.TOTL.GD.ZS', 'SL.UEM.TOTL.ZS')]), ]
plotmeans(tax_data$GC.TAX.TOTL.GD.ZS ~ tax_data$country, main=c("Hetereogeneidad entre países"), xlab = "Países", ylab = "% Tax Revenue")
## Warning in arrows(x, li, x, pmax(y - gap, li), col = barcol, lwd = lwd, :
## zero-length arrow is of indeterminate angle and so skipped
## Warning in arrows(x, li, x, pmax(y - gap, li), col = barcol, lwd = lwd, :
## zero-length arrow is of indeterminate angle and so skipped
## Warning in arrows(x, ui, x, pmin(y + gap, ui), col = barcol, lwd = lwd, :
## zero-length arrow is of indeterminate angle and so skipped
## Warning in arrows(x, ui, x, pmin(y + gap, ui), col = barcol, lwd = lwd, :
## zero-length arrow is of indeterminate angle and so skipped
#####Si es deseable porque estamos estudiando la variabilidad en estos grupos, en este caso el porcentaje de ingresos fiscales en 4 diferentes países.
plotmeans(tax_data$GC.TAX.TOTL.GD.ZS ~ tax_data$date, main=c("Hetereogeneidad entre años"), xlab = "Años", ylab = "% Tax Revenue")
pooled <- plm(GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG+ SL.UEM.TOTL.ZS, data = panel_tax, model = "pooling")
summary(pooled)
## Pooling Model
##
## Call:
## plm(formula = GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG +
## SL.UEM.TOTL.ZS, data = panel_tax, model = "pooling")
##
## Unbalanced Panel: n = 4, T = 2-3, N = 11
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -6.3411 -4.3056 -1.0662 4.4678 6.9494
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) 18.48880 13.71582 1.3480 0.2197
## NY.GDP.MKTP.KD.ZG -0.30304 0.64841 -0.4674 0.6544
## FP.CPI.TOTL.ZG 0.74775 2.45885 0.3041 0.7699
## SL.UEM.TOTL.ZS -0.44353 1.35648 -0.3270 0.7533
##
## Total Sum of Squares: 275.48
## Residual Sum of Squares: 259.48
## R-Squared: 0.058068
## Adj. R-Squared: -0.34562
## F-statistic: 0.143845 on 3 and 7 DF, p-value: 0.9304
within <- plm(GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG + SL.UEM.TOTL.ZS, data = panel_tax, model = "within")
summary(within)
## Oneway (individual) effect Within Model
##
## Call:
## plm(formula = GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG +
## SL.UEM.TOTL.ZS, data = panel_tax, model = "within")
##
## Unbalanced Panel: n = 4, T = 2-3, N = 11
##
## Residuals:
## 1 2 3 4 5 6 7 8
## 0.997178 -2.050875 1.053697 0.840679 -1.489340 0.648661 0.403681 -0.403681
## 9 10 11
## 0.250228 -0.269124 0.018896
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## NY.GDP.MKTP.KD.ZG -0.10375 0.17706 -0.5860 0.5894
## FP.CPI.TOTL.ZG 0.23519 0.65436 0.3594 0.7375
## SL.UEM.TOTL.ZS -0.64215 0.42809 -1.5000 0.2080
##
## Total Sum of Squares: 19.016
## Residual Sum of Squares: 10.118
## R-Squared: 0.46792
## Adj. R-Squared: -0.33019
## F-statistic: 1.17258 on 3 and 4 DF, p-value: 0.42445
pFtest(within,pooled)
##
## F test for individual effects
##
## data: GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG + SL.UEM.TOTL.ZS
## F = 32.862, df1 = 3, df2 = 4, p-value = 0.002813
## alternative hypothesis: significant effects
walhus <- plm(GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG + SL.UEM.TOTL.ZS, data = panel_tax, model = "random", random.method = "walhus")
summary(walhus)
## Oneway (individual) effect Random Effect Model
## (Wallace-Hussain's transformation)
##
## Call:
## plm(formula = GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG +
## SL.UEM.TOTL.ZS, data = panel_tax, model = "random", random.method = "walhus")
##
## Unbalanced Panel: n = 4, T = 2-3, N = 11
##
## Effects:
## var std.dev share
## idiosyncratic 0.000 0.000 0
## individual 40.969 6.401 1
## theta:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1 1 1 1 1 1
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -2.05087 -0.33640 0.25023 0.74467 1.05370
##
## Coefficients:
## Estimate Std. Error z-value Pr(>|z|)
## NY.GDP.MKTP.KD.ZG -0.10375 0.12520 -0.8287 0.40728
## FP.CPI.TOTL.ZG 0.23519 0.46270 0.5083 0.61125
## SL.UEM.TOTL.ZS -0.64215 0.30270 -2.1214 0.03389 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 19.016
## Residual Sum of Squares: 10.118
## R-Squared: 0.46792
## Adj. R-Squared: 0.33491
## Chisq: 7.03547 on 2 DF, p-value: 0.029667
amemiya <- plm(GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG + SL.UEM.TOTL.ZS, data = panel_tax, model = "random", random.method = "amemiya")
summary(amemiya)
## Oneway (individual) effect Random Effect Model
## (Amemiya's transformation)
##
## Call:
## plm(formula = GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG +
## SL.UEM.TOTL.ZS, data = panel_tax, model = "random", random.method = "amemiya")
##
## Unbalanced Panel: n = 4, T = 2-3, N = 11
##
## Effects:
## var std.dev share
## idiosyncratic 2.529 1.590 0.078
## individual 29.931 5.471 0.922
## theta:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.7987 0.8345 0.8345 0.8280 0.8345 0.8345
##
## Residuals:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -1.979 -1.204 0.107 -0.042 1.066 1.738
##
## Coefficients:
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept) 21.10299 4.84735 4.3535 1.34e-05 ***
## NY.GDP.MKTP.KD.ZG -0.10696 0.17770 -0.6019 0.5472
## FP.CPI.TOTL.ZG 0.24306 0.65751 0.3697 0.7116
## SL.UEM.TOTL.ZS -0.61834 0.42603 -1.4514 0.1467
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 29.009
## Residual Sum of Squares: 17.912
## R-Squared: 0.39037
## Adj. R-Squared: 0.1291
## Chisq: 3.34925 on 3 DF, p-value: 0.34085
nerlove <- plm(GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG + SL.UEM.TOTL.ZS, data = panel_tax, model = "random", random.method = "nerlove")
summary(nerlove)
## Oneway (individual) effect Random Effect Model
## (Nerlove's transformation)
##
## Call:
## plm(formula = GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG +
## SL.UEM.TOTL.ZS, data = panel_tax, model = "random", random.method = "nerlove")
##
## Unbalanced Panel: n = 4, T = 2-3, N = 11
##
## Effects:
## var std.dev share
## idiosyncratic 0.9198 0.9591 0.029
## individual 30.9357 5.5620 0.971
## theta:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.8790 0.9009 0.9009 0.8969 0.9009 0.9009
##
## Residuals:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -1.785 -0.773 0.225 -0.026 0.809 1.460
##
## Coefficients:
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept) 21.24026 5.20627 4.0797 4.509e-05 ***
## NY.GDP.MKTP.KD.ZG -0.10486 0.15113 -0.6938 0.48779
## FP.CPI.TOTL.ZG 0.23789 0.55878 0.4257 0.67031
## SL.UEM.TOTL.ZS -0.63331 0.36427 -1.7385 0.08212 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 22.629
## Residual Sum of Squares: 12.92
## R-Squared: 0.43059
## Adj. R-Squared: 0.18655
## Chisq: 4.7533 on 3 DF, p-value: 0.19078
phtest(amemiya,within)
##
## Hausman Test
##
## data: GC.TAX.TOTL.GD.ZS ~ NY.GDP.MKTP.KD.ZG + FP.CPI.TOTL.ZG + SL.UEM.TOTL.ZS
## chisq = 0.016122, df = 3, p-value = 0.9995
## alternative hypothesis: one model is inconsistent
B1<- read_excel('Act_1_Datos.xlsx')
B1 <- pdata.frame(B1, index = c("cusip","year"))
levels(factor(B1$year))
## [1] "2012" "2013" "2014" "2015" "2016" "2017" "2018" "2019" "2020" "2021"
levels(factor(B1$cusip))
## [1] "800" "4626" "4671" "7500" "7603" "20753" "21367" "23519"
## [9] "29069" "38213" "54303" "67131" "67383" "74077" "77491" "87509"
## [17] "87779" "105655" "118745" "125761" "126149" "134429" "147195" "149123"
## [25] "158663" "165339" "171196" "172172" "189873" "200291" "202363" "212363"
## [33] "212813" "229669" "235773" "235811" "244199" "252741" "266867" "268039"
## [41] "277461" "278058" "286065" "296659" "296695" "303711" "316549" "345370"
## [49] "345838" "350244" "351604" "361428" "361556" "361606" "362360" "368298"
## [57] "368514" "369032" "369154" "369550" "369604" "369856" "370622" "370838"
## [65] "372298" "375046" "375766" "377352" "383492" "383550" "383883" "384109"
## [73] "390568" "402784" "404245" "413342" "413875" "415864" "421596" "422191"
## [81] "423002" "423236" "428399" "428875" "429812" "439272" "449290" "449680"
## [89] "451542" "451650" "456866" "457186" "457776" "459101" "459200" "459506"
## [97] "459578" "459884" "460043" "461135" "462218" "465632" "479169" "481070"
## [105] "481088" "481196" "486872" "487836" "489170" "493503" "494368" "495620"
## [113] "501026" "501206" "503624" "505336" "513696" "513847" "524660" "530000"
## [121] "538021" "539821" "540137" "540210" "541381" "543213" "551120" "551137"
## [129] "552618" "562706" "574055" "574599" "575379" "576680" "580033" "580169"
## [137] "580628" "585055" "589331" "597715" "601073" "608030" "608183" "620076"
## [145] "629853" "637742" "670148" "670250" "680665" "690207" "690734" "690768"
## [153] "704562" "707389" "717081" "718320" "724479" "727346" "727491" "736245"
## [161] "737407" "739732" "739868" "740512" "746252" "746299" "749720" "749738"
## [169] "750633" "754688" "754713" "755111" "756040" "758114" "760354" "760881"
## [177] "760898" "761406" "766481" "767329" "768024" "770196" "770519" "770553"
## [185] "775133" "775371" "776338" "776678" "776755" "784015" "784626" "794099"
## [193] "799850" "809367" "809877" "810640" "817698" "817732" "820208" "822440"
## [201] "826520" "828675" "831865" "832110" "832248" "832377" "833034" "847235"
## [209] "847567" "847660" "848355" "853683" "853700" "853734" "853836" "853887"
## [217] "857721" "859264" "866645" "866762" "871140" "871565" "871616" "878308"
## [225] "878555"
plotmeans(B1$patentsg ~ B1$cusip , main=c("Hetereogeneidad entre empresas"), xlab = "Empresas", ylab = "Patentes obtenidas")
plotmeans(B1$patentsg ~ B1$year , main=c("Hetereogeneidad entre años"), xlab = "Años", ylab = "Patentes obtenidas")
### Modelo 1. Regresión agrupada (pooled)
pooled <- plm(B1$patentsg ~ B1$employ + B1$return + B1$rnd + B1$sales, data = B1, model ="pooling")
summary(pooled)
## Pooling Model
##
## Call:
## plm(formula = B1$patentsg ~ B1$employ + B1$return + B1$rnd +
## B1$sales, data = B1, model = "pooling")
##
## Unbalanced Panel: n = 225, T = 6-10, N = 2231
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -442.2632 -10.6067 -4.7467 1.8298 529.4454
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) -2.60509434 2.02574892 -1.2860 0.1986
## B1$employ 1.50807467 0.04815018 31.3202 < 2.2e-16 ***
## B1$return 0.91196207 0.20254442 4.5025 7.062e-06 ***
## B1$rnd -0.07961494 0.01855815 -4.2900 1.863e-05 ***
## B1$sales -0.00270527 0.00054283 -4.9836 6.721e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 14148000
## Residual Sum of Squares: 6158700
## R-Squared: 0.56471
## Adj. R-Squared: 0.56392
## F-statistic: 721.947 on 4 and 2226 DF, p-value: < 2.22e-16
within <- plm(B1$patentsg ~ B1$employ + B1$return + B1$rnd + B1$sales, data = B1, model ="within")
summary(within)
## Oneway (individual) effect Within Model
##
## Call:
## plm(formula = B1$patentsg ~ B1$employ + B1$return + B1$rnd +
## B1$sales, data = B1, model = "within")
##
## Unbalanced Panel: n = 225, T = 6-10, N = 2231
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -218.71094 -1.90284 -0.31552 1.52880 269.85101
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## B1$employ -0.06083751 0.06114261 -0.9950 0.3199
## B1$return -0.00629415 0.09150254 -0.0688 0.9452
## B1$rnd -0.14406290 0.01203980 -11.9656 < 2.2e-16 ***
## B1$sales -0.00156945 0.00035451 -4.4271 1.006e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 715600
## Residual Sum of Squares: 590200
## R-Squared: 0.17523
## Adj. R-Squared: 0.081304
## F-statistic: 106.338 on 4 and 2002 DF, p-value: < 2.22e-16
pFtest(within,pooled)
##
## F test for individual effects
##
## data: B1$patentsg ~ B1$employ + B1$return + B1$rnd + B1$sales
## F = 84.324, df1 = 224, df2 = 2002, p-value < 2.2e-16
## alternative hypothesis: significant effects
walhus <- plm(B1$patentsg ~ B1$employ + B1$return + B1$rnd + B1$sales, data = B1, model ="random",random.method = "walhus")
summary(walhus)
## Oneway (individual) effect Random Effect Model
## (Wallace-Hussain's transformation)
##
## Call:
## plm(formula = B1$patentsg ~ B1$employ + B1$return + B1$rnd +
## B1$sales, data = B1, model = "random", random.method = "walhus")
##
## Unbalanced Panel: n = 225, T = 6-10, N = 2231
##
## Effects:
## var std.dev share
## idiosyncratic 415.44 20.38 0.148
## individual 2386.33 48.85 0.852
## theta:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.8321 0.8692 0.8692 0.8687 0.8692 0.8692
##
## Residuals:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -147.865 -3.953 -2.584 0.010 -0.127 315.974
##
## Coefficients:
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept) 18.07605240 3.28303531 5.5059 3.673e-08 ***
## B1$employ 0.79528326 0.04960570 16.0321 < 2.2e-16 ***
## B1$return 0.05885953 0.10066248 0.5847 0.5587
## B1$rnd -0.11420604 0.01291561 -8.8425 < 2.2e-16 ***
## B1$sales -0.00231051 0.00038081 -6.0674 1.300e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 945440
## Residual Sum of Squares: 807880
## R-Squared: 0.1455
## Adj. R-Squared: 0.14396
## Chisq: 379.632 on 4 DF, p-value: < 2.22e-16
amemiya <- plm(B1$patentsg ~ B1$employ + B1$return + B1$rnd + B1$sales, data = B1, model ="random",random.method = "amemiya")
summary(amemiya)
## Oneway (individual) effect Random Effect Model
## (Amemiya's transformation)
##
## Call:
## plm(formula = B1$patentsg ~ B1$employ + B1$return + B1$rnd +
## B1$sales, data = B1, model = "random", random.method = "amemiya")
##
## Unbalanced Panel: n = 225, T = 6-10, N = 2231
##
## Effects:
## var std.dev share
## idiosyncratic 294.81 17.17 0.031
## individual 9324.74 96.56 0.969
## theta:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.9276 0.9439 0.9439 0.9436 0.9439 0.9439
##
## Residuals:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -174.774 -3.102 -1.837 0.007 0.320 292.169
##
## Coefficients:
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept) 29.31234567 6.52194041 4.4944 6.976e-06 ***
## B1$employ 0.21509532 0.05601519 3.8399 0.0001231 ***
## B1$return 0.01091431 0.09075130 0.1203 0.9042723
## B1$rnd -0.13455738 0.01187400 -11.3321 < 2.2e-16 ***
## B1$sales -0.00180826 0.00034979 -5.1696 2.346e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 757930
## Residual Sum of Squares: 647590
## R-Squared: 0.14558
## Adj. R-Squared: 0.14404
## Chisq: 379.406 on 4 DF, p-value: < 2.22e-16
nerlove <- plm(B1$patentsg ~ B1$employ + B1$return + B1$rnd + B1$sales, data = B1, model ="random",random.method = "nerlove")
summary(nerlove)
## Oneway (individual) effect Random Effect Model
## (Nerlove's transformation)
##
## Call:
## plm(formula = B1$patentsg ~ B1$employ + B1$return + B1$rnd +
## B1$sales, data = B1, model = "random", random.method = "nerlove")
##
## Unbalanced Panel: n = 225, T = 6-10, N = 2231
##
## Effects:
## var std.dev share
## idiosyncratic 264.55 16.26 0.027
## individual 9363.75 96.77 0.973
## theta:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.9315 0.9469 0.9469 0.9467 0.9469 0.9469
##
## Residuals:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -176.538 -3.052 -1.776 0.007 0.390 290.975
##
## Coefficients:
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept) 29.78825965 6.85746950 4.3439 1.400e-05 ***
## B1$employ 0.19033027 0.05621848 3.3855 0.0007104 ***
## B1$return 0.00928606 0.09038544 0.1027 0.9181706
## B1$rnd -0.13541319 0.01183277 -11.4439 < 2.2e-16 ***
## B1$sales -0.00178682 0.00034856 -5.1263 2.954e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 753440
## Residual Sum of Squares: 642170
## R-Squared: 0.14769
## Adj. R-Squared: 0.14616
## Chisq: 385.851 on 4 DF, p-value: < 2.22e-16
phtest(nerlove,within)
##
## Hausman Test
##
## data: B1$patentsg ~ B1$employ + B1$return + B1$rnd + B1$sales
## chisq = 111.71, df = 4, p-value < 2.2e-16
## alternative hypothesis: one model is inconsistent