aambarek / GiniDecompLY

Package for Gini Decomposition by income sources.
1 stars 0 forks source link

Trying to use GiniDecompLY #1

Closed caromoree closed 1 year ago

caromoree commented 1 year ago

Hi Abdessamad!

I'm currently working on thesis about economic inequalities and I would like to perform a gini decomposition using Lerman and Yitzhaki methodology as your package does.

I have problems to understand how to get the Rk component, and searching for an answer on the internet I found you.

I tried to find more information about how the functions of your package could be used but I just found the information you provide on your GitHub account.

I tried to use the function gini_decomp_source() on SCF 2019 data but I keep having the same following error : Error in dplyr::select()

I write you here the line one of the lines of code I used:

gini_decomp_source(SCF_2019,income~wageinc+bussefarminc+capital+ssretinc+penacctwd+transfothinc+rent,wgt=wgt)

I thank you in advance for all the help you could give to me. Best regards, Carolina Moreno

aambarek commented 1 year ago

Hello Carolina, I’m glad to hear that you found my contribution useful for your problem. In fact, I didn’t write a documentation for the package. The source of error I assume is in the second argument. The right call for the function in your case is the following: gini_decomp_source(SCF_2019, wageinc,bussefarminc,capital,ssretinc,penacctwd,transfothinc,rent,.wgt=wgt) The function does not use a formula to tell which variables represent the income sources. Just list them after the data argument, and tyen you can pass .wgt and .by arguments by their names. I hope I make it clearer for the use of the function. I’ll still available for further support. Best regards, Abdessamad.

caromoree commented 1 year ago

Hello! Thank you very much for your answer. I did what you said and it works!!. I have built my own code before receiving your answer and results using your package are close to mine. Still studying your functions to understand the calculations you do, and the source of differences. Thank you again and have a nice day. Kind regards, CMF