Comparative advantage trade specialization analysis

<`Goodmorning, I need to perform a country-wise stability analysis on trade revealed comparative advantage indicators. Problem is that the plm function doesn't exist anymore and so i needed to work only with lm functions. I need to test the convergence/divergence of a country in the sparkling wine in in three time periods, bottled wine or bulk wine sector with respect to the entire wine sector. (in other words in which sector is the country more specialized. I need to get beta values for each sector, but i don't know how to get them. Is there anyone who could help me, please? Here's my code:

dataARG<- read_excel("COUNTRYWISE.xlsx", sheet = "ARGENTINA")

resultsARG1<-lm(RSCA2019 ~ RSCA1995, data=dataARG)
summary(resultsARG1)

resultsARG2<-lm(RSCA2019~ RSCA2007, data=dataARG)
summary(resultsARG2)

resultsARG3<-lm(RSCA2007~ RSCA1995, data=dataARG)
summary(resultsARG3)

require(stargazer)
library(stargazer)
stargazer(resultsARG1, resultsARG2, resultsARG3, title="RSCA ARGENTINA 1995-2019", type="html", out="ARGRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA2019")

#ANALYSIS AUSTRALIA
dataAUS<- read_excel("COUNTRYWISE.xlsx", sheet = "AUSTRALIA")

resultsAUS1<-lm(RSCA2019 ~ RSCA1995, data=dataAUS)
summary(resultsAUS1)

resultsAUS2<-lm(RSCA2019~ RSCA2007, data=dataAUS)
summary(resultsAUS2)

resultsAUS3<-lm(RSCA2007~ RSCA1995, data=dataAUS)
summary(resultsAUS3)

require(stargazer)
library(stargazer)
stargazer(resultsAUS1, resultsAUS2, resultsAUS3, title="RSCA AUSTRALIA 1995-2019", type="html", out="AUSRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS CHILE
dataCHL<- read_excel("COUNTRYWISE.xlsx", sheet = "CHILE")

resultsCHL1<-lm(RSCA2019 ~ RSCA1995, data=dataCHL)
summary(resultsCHL1)

resultsCHL2<-lm(RSCA2019~ RSCA2007, data=dataCHL)
summary(resultsCHL2)

resultsCHL3<-lm(RSCA2007~ RSCA1995, data=dataCHL)
summary(resultsCHL3)

require(stargazer)
library(stargazer)
stargazer(resultsCHL1, resultsCHL2, resultsCHL3, title="RSCA CHILE 1995-2019", type="html", out="CHLRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS FRANCE
dataFRA<- read_excel("COUNTRYWISE.xlsx", sheet = "FRANCE")

resultsFRA1<-lm(RSCA2019 ~ RSCA1995, data=dataFRA)
summary(resultsFRA1)

resultsFRA2<-lm(RSCA2019~ RSCA2007, data=dataFRA)
summary(resultsFRA2)

resultsFRA3<-lm(RSCA2007~ RSCA1995, data=dataFRA)
summary(resultsFRA3)

require(stargazer)
library(stargazer)
stargazer(resultsFRA1, resultsFRA2, resultsFRA3, title="RSCA FRA 1995-2019", type="html", out="FRARSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS ITALY
dataITA<- read_excel("COUNTRYWISE.xlsx", sheet = "ITALY")

resultsITA1<-lm(RSCA2019 ~ RSCA1995, data=dataITA)
summary(resultsITA1)

resultsITA2<-lm(RSCA2019~ RSCA2007, data=dataITA)
summary(resultsITA2)

resultsITA3<-lm(RSCA2007~ RSCA1995, data=dataITA)
summary(resultsITA3)

require(stargazer)
library(stargazer)
stargazer(resultsITA1, resultsITA2, resultsITA3, title="RSCA ITALY 1995-2019", type="html", out="ITARSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS SOUTH AFRICA
dataS_AFR<- read_excel("COUNTRYWISE.xlsx", sheet = "SOUTH AFRICA")

resultsS_AFR1<-lm(RSCA2019 ~ RSCA2000, data=dataS_AFR)
summary(resultsS_AFR1)

resultsS_AFR2<-lm(RSCA2019~ RSCA2007, data=dataS_AFR)
summary(resultsS_AFR2)

resultsS_AFR3<-lm(RSCA2007~ RSCA2000, data=dataS_AFR)
summary(resultsS_AFR3)

require(stargazer)
library(stargazer)
stargazer(resultsS_AFR1, resultsS_AFR2, resultsS_AFR3, title="RSCA SOUTH AFRICA 2000-2019", type="html", out="S.AFRRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS SPAIN
dataSPN<- read_excel("COUNTRYWISE.xlsx", sheet = "SPAIN")

resultsSPN1<-lm(RSCA2019 ~ RSCA1995, data=dataSPN)
summary(resultsSPN1)

resultsSPN2<-lm(RSCA2019~ RSCA2007, data=dataSPN)
summary(resultsSPN2)

resultsSPN3<-lm(RSCA2007~ RSCA1995, data=dataSPN)
summary(resultsSPN3)

require(stargazer)
library(stargazer)
stargazer(resultsSPN1, resultsSPN2, resultsSPN3, title="RSCA SPAIN 1995-2019", type="html", out="SPNRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS USA
dataUSA<- read_excel("COUNTRYWISE.xlsx", sheet = "USA")

resultsUSA1<-lm(RSCA2019 ~ RSCA1995, data=dataUSA)
summary(resultsUSA1)

resultsUSA2<-lm(RSCA2019~ RSCA2007, data=dataUSA)
summary(resultsUSA2)

resultsUSA3<-lm(RSCA2007~ RSCA1995, data=dataUSA)
summary(resultsUSA3)

require(stargazer)
library(stargazer)
stargazer(resultsUSA1, resultsUSA2, resultsUSA3, title="RSCA USA 1995-2019", type="html", out="USARSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

`Goodmorning, I need to perform a country-wise stability analysis on trade revealed comparative advantage indicators. Problem is that the plm function doesn't exist anymore and so i needed to work only with lm functions. I need to test the convergence/divergence of a country in the sparkling wine in in three time periods, bottled wine or bulk wine sector with respect to the entire wine sector. (in other words in which sector is the country more specialized. Here's my code:

dataARG<- read_excel("COUNTRYWISE.xlsx", sheet = "ARGENTINA")

resultsARG1<-lm(RSCA2019 ~ RSCA1995, data=dataARG)
summary(resultsARG1)

resultsARG2<-lm(RSCA2019~ RSCA2007, data=dataARG)
summary(resultsARG2)

resultsARG3<-lm(RSCA2007~ RSCA1995, data=dataARG)
summary(resultsARG3)

require(stargazer)
library(stargazer)
stargazer(resultsARG1, resultsARG2, resultsARG3, title="RSCA ARGENTINA 1995-2019", type="html", out="ARGRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA2019")

#ANALYSIS AUSTRALIA
dataAUS<- read_excel("COUNTRYWISE.xlsx", sheet = "AUSTRALIA")

resultsAUS1<-lm(RSCA2019 ~ RSCA1995, data=dataAUS)
summary(resultsAUS1)

resultsAUS2<-lm(RSCA2019~ RSCA2007, data=dataAUS)
summary(resultsAUS2)

resultsAUS3<-lm(RSCA2007~ RSCA1995, data=dataAUS)
summary(resultsAUS3)

require(stargazer)
library(stargazer)
stargazer(resultsAUS1, resultsAUS2, resultsAUS3, title="RSCA AUSTRALIA 1995-2019", type="html", out="AUSRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS CHILE
dataCHL<- read_excel("COUNTRYWISE.xlsx", sheet = "CHILE")

resultsCHL1<-lm(RSCA2019 ~ RSCA1995, data=dataCHL)
summary(resultsCHL1)

resultsCHL2<-lm(RSCA2019~ RSCA2007, data=dataCHL)
summary(resultsCHL2)

resultsCHL3<-lm(RSCA2007~ RSCA1995, data=dataCHL)
summary(resultsCHL3)

require(stargazer)
library(stargazer)
stargazer(resultsCHL1, resultsCHL2, resultsCHL3, title="RSCA CHILE 1995-2019", type="html", out="CHLRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS FRANCE
dataFRA<- read_excel("COUNTRYWISE.xlsx", sheet = "FRANCE")

resultsFRA1<-lm(RSCA2019 ~ RSCA1995, data=dataFRA)
summary(resultsFRA1)

resultsFRA2<-lm(RSCA2019~ RSCA2007, data=dataFRA)
summary(resultsFRA2)

resultsFRA3<-lm(RSCA2007~ RSCA1995, data=dataFRA)
summary(resultsFRA3)

require(stargazer)
library(stargazer)
stargazer(resultsFRA1, resultsFRA2, resultsFRA3, title="RSCA FRA 1995-2019", type="html", out="FRARSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS ITALY
dataITA<- read_excel("COUNTRYWISE.xlsx", sheet = "ITALY")

resultsITA1<-lm(RSCA2019 ~ RSCA1995, data=dataITA)
summary(resultsITA1)

resultsITA2<-lm(RSCA2019~ RSCA2007, data=dataITA)
summary(resultsITA2)

resultsITA3<-lm(RSCA2007~ RSCA1995, data=dataITA)
summary(resultsITA3)

require(stargazer)
library(stargazer)
stargazer(resultsITA1, resultsITA2, resultsITA3, title="RSCA ITALY 1995-2019", type="html", out="ITARSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS SOUTH AFRICA
dataS_AFR<- read_excel("COUNTRYWISE.xlsx", sheet = "SOUTH AFRICA")

resultsS_AFR1<-lm(RSCA2019 ~ RSCA2000, data=dataS_AFR)
summary(resultsS_AFR1)

resultsS_AFR2<-lm(RSCA2019~ RSCA2007, data=dataS_AFR)
summary(resultsS_AFR2)

resultsS_AFR3<-lm(RSCA2007~ RSCA2000, data=dataS_AFR)
summary(resultsS_AFR3)

require(stargazer)
library(stargazer)
stargazer(resultsS_AFR1, resultsS_AFR2, resultsS_AFR3, title="RSCA SOUTH AFRICA 2000-2019", type="html", out="S.AFRRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS SPAIN
dataSPN<- read_excel("COUNTRYWISE.xlsx", sheet = "SPAIN")

resultsSPN1<-lm(RSCA2019 ~ RSCA1995, data=dataSPN)
summary(resultsSPN1)

resultsSPN2<-lm(RSCA2019~ RSCA2007, data=dataSPN)
summary(resultsSPN2)

resultsSPN3<-lm(RSCA2007~ RSCA1995, data=dataSPN)
summary(resultsSPN3)

require(stargazer)
library(stargazer)
stargazer(resultsSPN1, resultsSPN2, resultsSPN3, title="RSCA SPAIN 1995-2019", type="html", out="SPNRSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")

#ANALYSIS USA
dataUSA<- read_excel("COUNTRYWISE.xlsx", sheet = "USA")

resultsUSA1<-lm(RSCA2019 ~ RSCA1995, data=dataUSA)
summary(resultsUSA1)

resultsUSA2<-lm(RSCA2019~ RSCA2007, data=dataUSA)
summary(resultsUSA2)

resultsUSA3<-lm(RSCA2007~ RSCA1995, data=dataUSA)
summary(resultsUSA3)

require(stargazer)
library(stargazer)
stargazer(resultsUSA1, resultsUSA2, resultsUSA3, title="RSCA USA 1995-2019", type="html", out="USARSCA.htm",
align=TRUE, no.space = TRUE, df=FALSE, digits=4,
dep.var.labels= "RSCA 2019")`

What does this mean ?
I would think that you are simply mistaken on this point, unless you can clarify


I have always used it, but then one day last week Rstudio did an update and now the plm function doesn't work anymore. i can see it in my library, and if I click on it to activate it this is what i get Error: failed to load package or namespace for 'plm' in loadNamespace (j <- i [[1L]], c (lib.loc, .libPaths ()), versionCheck = vI [[j]]): there is no package called 'rbibutils'

You are on a macOS therefore to build R packages from source you will need XCode, I saw a message in your errors listed that xcrun is missing, and I believe thats a part of XCode.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.