paulofelipe / Structural-Gravity

R codes to "An Advanced Guide to Trade Policy Analysis: The Structural Gravity Model"
12 stars 11 forks source link

gravity_ppml #1

Closed ItsNikat closed 6 years ago

ItsNikat commented 6 years ago

Dear @paulofelipe,

First of all I would like to thank you so much for your coding in R. I am currently working on a gravity model to test infrastructure weight on trade using R for my master thesis, but being it the first time I am doing it, your work is truly saving a lot of my time. Secondly, I am having troubles in using the gravity_ppml function. I can't find this function anywhere. It is not listed in the speedglm package, nor in any other packages I've been looking through. Could you please help me? A lot of codes I would like to replicate to get the results of the book have the gravity_ppml function. Thank you a lot!

paulofelipe commented 6 years ago

Hi @NicolettaCascio

Indeed, the gravity_ppml function is not part of any R package. The function is defined in aux_functions.R file. You have to source this script to make the function available.

I hope this helps.

ItsNikat commented 6 years ago

Hi @paulofelipe, I've found it just few minutes after writing you the commment, and just succesfully made it run. I was hoping you didn't see it yet and wanted to delete the comment, since the question sounds now very stupid... Struggling now with the "mutate_each" which is deprecated, but with mutate_at it gives me some errors. Thank you very much though for your very kind and quick answer!

paulofelipe commented 6 years ago

@NicolettaCascio maybe the solution is mutate_all(). The code was written in an older dplyr version. I'll update soon.