TransWikia.com

prodest package in R, TFP growth estimation

Economics Asked on May 14, 2021

I have a question regarding the results and its transformations received from prodest package estimation. So, the dataset is available here https://drive.google.com/file/d/1aedWYABus1fQjKWxkOmYOmxv-qSja7hF/view?usp=sharing. My code is the following:

remove(list=ls())

library(plm)
library(dplyr)
library(ggplot2)
library(prodest)
library(estprod)
library(broom)
library(pdynmc)

pckg<-c("plm","readxl","dplyr","ggplot2", "broom","prodest", "estprod")
install.packages(c("plm","readxl","dplyr","ggplot2", "broom","prodest", "estprod"))
lapply(pckg, require, character.only = TRUE)

# Set the working directory
setwd("C:/Users/vadya/Desktop/baka")

# Downloading the survey data
Data <- read.csv("LV.csv", header=TRUE, sep=",")
str(Data)

Data$ID<-as.numeric(as.factor(Data$ID))

summary(Data)

# Creating a panel data frame
PData <- pdata.frame(Data, index = c("ID","Year"))

pdim(PData)
pvar(PData)

DataA <- Data %>% 
  filter(NACE == 'A' & Year < 2014) %>% 
  filter(VA > 0, L > 0, K > 0, M > 0) %>%
  select(ID, Year, L, VA, K, M) %>% 
  summarise(ID = ID,
            Year = Year,
            l = log(L),
            va = log(VA),
            k = log(K),
            m = log(M))
  
####################################################################################################################################
mod2LP <- prodest::prodestLP(DataA$va, fX = DataA$l, sX = DataA$k, pX = DataA$m, idvar = DataA$ID, timevar = DataA$Year, 
                             R = 100, cX = NULL, opt = "optim", theta0 = NULL, cluster = NULL, tol = 1e-100, exit = FALSE)  
mod2LP
omegaLP <- prodest::omega(mod2LP)
summary(mod2LP)
summary(omegaLP)



mod2OP <- prodest::prodestOP(DataA$va, fX = DataA$l, sX = DataA$k, pX = DataA$m, idvar = DataA$ID, timevar = DataA$Year, 
                             R = 100, cX = NULL, opt = "optim", theta0 = NULL, cluster = NULL, tol = 1e-100, exit = FALSE)  

mod2OP
omegaOP <- prodest::omega(mod2OP)
summary(mod2OP)
summary(omegaOP)



mod2ACF <-  prodest::prodestACF(DataA$va, fX = DataA$l, sX = DataA$k, pX = DataA$m, idvar = DataA$ID, timevar = DataA$Year, 
                                R = 100, cX = NULL, opt = 'optim', theta0 = NULL, cluster = NULL)  

mod2ACF
omegaACF <- prodest::omega(mod2ACF)
summary(mod2ACF)
summary(omegaACF)



mod2W <-  prodest::prodestWRDG_GMM(DataA$va, fX = DataA$l, sX = DataA$k, pX = DataA$m, idvar = DataA$ID, timevar = DataA$Year, 
                                   cX = NULL, tol = 1e-100)  
mod2W
omegaW <- prodest::omega(mod2W)
summary(mod2W)
summary(omegaW)

####################################################################################################################################

After using the omega function I receive the summary statistics of the TFP estimation. However, if I want to assign this omega function output to another object, I end up with matrix of randomly assigned numbers (I guess so). Hence, the problem is that my dataset is from 2011 till 2019, and I need to get the change of the TFP YoY or, basically the growth of it for each entity separately YoY. Would really much appreciate your suggestions since I tried a lot of things (including changing the overall function prodest in order to get the TFP assigned to each firm in each year, but nothing really helped).

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP