I want to calculate the TFP by using the estprod function (I use R 4.0.2). As far as I understood the only way to calculate the TFP is manual following this logic .
omega_1 = (data$Y - data$Labor*coefs$statistic[1] - data$Capital*coefs$statistic[2] - data$Materials*coefs$statistic[3])
- this is basically the approach other author on StackExchange suggested to use in order to calculate the TFP. However, after running the regressions (LP, OP, Wooldridge) I get only 2 coefficients in the output, for capital and fo labor only, while for materials the coefficient is missing.
Would really much appreciate any comments and support, the dataset is available here: https://drive.google.com/file/d/1aedWYABus1fQjKWxkOmYOmxv-qSja7hF/view?usp=sharing
The code is the following so far:
remove(list=ls())
library(plm)
library(dplyr)
library(ggplot2)
library(prodest)
library(estprod)
library(broom)
# 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') %>%
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))
####################################################################################################################################
mod1LP = estprod::levinsohn_petrin(data = DataA, va ~ l | k | m, id = "ID", time = "Year", bootstrap = TRUE, gross = FALSE)
summary(mod1LP)
mod1OP = estprod::olley_pakes(data = DataA, va ~ l | k | m, id = "ID", time = "Year", bootstrap = TRUE, gross = FALSE)
summary(mod1OP)
mod1W = estprod::wooldridge(data = DataA, va ~ l | k | m, id = "ID", time = "Year", bootstrap = TRUE, gross = FALSE)
summary(mod1W)