gabrielerovigatti / prodest Goto Github PK
View Code? Open in Web Editor NEWStata and R functions for production function estimation
License: GNU General Public License v3.0
Stata and R functions for production function estimation
License: GNU General Public License v3.0
Hi,
The option fsresidual(newname) does not work with methods than OP or LP in the Stata code.
This problem could be reproduced so far with two different datasets including the example dataset provided with the package.
The problem occurs somewhere between the lines 546 - 551 where the temp file gets created and saved and lines 650 - 652 where the temp file should get merged with original dataset.
The attached log file prodest_error.log shows an example session. The example dataset gets loaded and described. The version number of the package is reported and the result of creturn list is shown. Afterwards the prodest command is called for the OP and LP method without problems, while using the WRDG and ROB method results in an invalid file specification error.
If needed, I could provide an output from a command run with set trace on.
Best regards
Sven-Kristjan
Hi again,
Please add guidelines for third parties who wish to contribute to the software.
Cheers,
Sebastian
Hi Gabriele,
Superb package!
For us who work with survey data however, sampling weights oftentimes need to be taken into account. Is it possible to implement the methods in the package with weights? So far I see no option for this.
Cheers.
Hi Gabriele
Insofar as I can tell, the GMM estimators in most of the code just use a first guess for the optimal weighting matrix, is that correct?
If you want, I can add some code to compute the 2-step GMM estimator with the asymptotically optimal weighting matrix?
Best
David
Hello.
I have an unbalanced data panel, where the firm ID is a string.
I was trying to get the Levinsohn-Petrin estimation.
This was my code
levpet <- prodestLP(base2$c_y, # log of value added
fX=base2$c_l, # log of wages
sX=base2$c_k, # log of capital
pX=base2$c_m, # log of materials
idvar=base2$ruc, # string id
timevar = base2$year, # numeric variable
R=30 )
And I got this error:
Error in `[[<-.data.frame`(`*tmp*`, i, value = c(42719L, 82109L, 82678L, :
replacement has 469326 rows, data has 78221
I don´t really know what´s the error or if this counts as a bug
But I created a numeric firm id and it worked.
Hello.
I am wondering if is there a way I could export the coefficients and standard errors to a dataframe.
I am trying with the following code in R:
levpet <- prodestLP(base$c_y,
fX=base$c_l,
sX=base$c_k,
pX=base$c_m,
idvar=base$idvar,
timevar = base$year,
R=5)
results_levpet <- data.frame(summary(levpet)$coef)
But I just get the chart with the coefficients in the console.
By the way. Is there a way to get the p-values for each coefficient? That would be awesome.
Thanks in advance.
Dear Gabriele,
Thanks for the useful package. I would ask you how shall one use industry fixed effect in your functions.
For instance, say that Chilean data further contained a few industries of data, for example, car/textile etc.
Is there any way that your existing functions could incorporate industry fixed effect, probably encoded as a factor variable? Will you provide an example if so?
Best regards,
Hi Gabrielle,
when trying to run a ACF-corrected model with non-NULL control variables the command throws an error:
prodestACF(Y = chilean$Y, fX = chilean$fX1, sX = chilean$sX,
pX = chilean$pX, cX = chilean$cX, idvar = chilean$idvar, timevar = chilean$timevar,
R = 5, opt = 'optim', theta0 = NULL, cluster = NULL)
yields
Warning message in coef(first.stage)[2:(1 + snum + fnum + cnum)] + rnorm((snum + :
“longer object length is not a multiple of shorter object length”Warning message in coef(first.stage)[2:(1 + snum + fnum + cnum)] + rnorm((snum + :
“longer object length is not a multiple of shorter object length”Warning message in coef(first.stage)[2:(1 + snum + fnum + cnum)] + rnorm((snum + :
“longer object length is not a multiple of shorter object length”Warning message in coef(first.stage)[2:(1 + snum + fnum + cnum)] + rnorm((snum + :
“longer object length is not a multiple of shorter object length”Warning message in coef(first.stage)[2:(1 + snum + fnum + cnum)] + rnorm((snum + :
“longer object length is not a multiple of shorter object length”Warning message in coef(first.stage)[2:(1 + snum + fnum + cnum)] + rnorm((snum + :
“longer object length is not a multiple of shorter object length”Warning message in matrix(unlist(lapply(boot.indices, finalACF, data = data, fnum = fnum, :
“data length [10] is not a sub-multiple or multiple of the number of rows [4]”
Error in names(betas$betas) <- res.names: 'names' attribute [3] must be the same length as the vector [2]
The issue maybe related to line 88 prodestACF.R
theta0 <- coef(first.stage)[2:(1 + snum + fnum + cnum)] + rnorm((snum + fnum), 0, 0.01)
because this implies that length(theta0) = snum+fnum+cnum
. But if length(theta0) = snum + fnum +cnum
the optimization routine on throws an error on line 144, namely that Error in mX %*% theta : non-conformable arguments
.
So I guess the problem is what the proper length of theta0
should be or rather if the controls matter in the second stage, no?
Thank you for the package,
Matthias
Hi,
I'm currently reviewing your package for JOSS. Can you please add a license with the contents of an OSI approved software license?
Cheers,
Sebastian
Hi Gabriele,
thank you for the awesome package!
I was wondering if it is possible to estimate a gross output production function with this package? I'm not sure since in the documentation it says input Y should be value added but in the details simply log output, and I believe in the STATA version the default is gross output.
So for example, if I have information on log sales/revenue, COGS and capital (identification issues aside),
prodestACF(Y = sales, fX = COGS , sX = capital, pX = COGS, ...)
would just be flat out wrong, no?
Thank you,
Best Matthias
Hi there
I cannot obtain the omega estimates from the example given in the package when using the Wooldridge GMM estimator.
I am assuming that this is because we are using lags as instruments in the GMM process so we lose observations therefore the VA (Y) is 1x1944 whilst the state & free vars are 1x2544. I can manually compute the omega but I wanted to check whether this was user error on my part?
Thanks,
Abigail
FSres does work for prodestACF, prodestLP and prodestOP,
but does not work for prodestROB, prodestWRDG, and prodestWRDG_GMM
please help to update it, thanks a lot.
When I call
data("chilean")
in R, the dataset has identical values for "cX" and "inv" variables, which according to the package are supposed to be "water" and "investment", respectively.
Clearly one is wrong - and I am hoping for my students' sake it's water - otherwise their OP problem set is going to be interesting...
Best,
Hi again,
Could you include an example of how to use the package - for example at the end of the README.md file? I know that the functions are documented in the CRAN package documentation, but a brief example would definitely increase usability.
Cheers,
Sebastian
Hi Gabriele,
Thank you for this powerful package!
My problem is, I ran the code twice and got different results. The problem is still here even I use your example code in the help files. Is there anything wrong so that I cannot replicate the results? BTW, I also find that estimated coefficients will also be changed if I use different reps(#). Based on my knowledge, it will only change the s.e. instead of the coeff. Please tell me if I am wrong.
Best regards,
Zhanyu
Dear Gabriele,
I am a MSc Economics student at the University of Greenwich contributing to a research team working on Innovation, markups, total factor productivity and labor share.
Thank you for the impressive markup estimation module on Stata.
I was wondering if the output (or value-added) is nominal (current prices) or real (constant prices)?
Thank you for your time and I look forward to hearing from you soon!
Best regards,
Aditya Alex Bysack.
Hi,
I think it'll be a good idea to update README.md
to include a guide to installation. For example: is the package on CRAN or should it be installed from github?
Cheers,
Sebastian
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.