fsolt / DCPOtools

Tools for facilitating research on cross-national collective attitudes—DCPO: Dynamic Comparative Public Opinion
Other
3 stars 4 forks source link

data_setup: revisit countrycode #35

Closed fsolt closed 4 years ago

fsolt commented 4 years ago

Currently using countrycode::countrycode() with a custom dictionary. I'd like to switch to the new countrycode::countryname(). Known issues: Northern Ireland gets an NA. United States and United Kingdom get "US" and "UK", respectively (blech). OTOH, handles South Sudan correctly, which current code whiffs on. Also would be much cleaner.

fsolt commented 4 years ago

Either pull the trigger on this, or revise country names in dcpo_dem_mood/R/cy_crosswalk.R to use the custom dictionary instead of countryname()

Tyhcass commented 4 years ago

@fsolt I tried to set up data for claassen's model 5 by using data-raw/mood_dem.csv, then my claassen_input_raw is different from data/claassen_input_raw. Excluding the countrycode problem( why some countries changed their name!!!), data/claassen_input_raw doesn't include the following data. All of them are from amb_combo. It is not an urgent thing since we don't need the latest data for the replication (I just want to see whether we could get the same data, and play the beautiful crosswalk codes for fun...). I will use data/claassen_input_raw to format data. 17 2016 church_amb 7 Dominican Republic 18 2019 church_amb 7 Dominican Republic 19 2016 church_amb 7 El Salvador 20 2016 strong_amb_1 2 El Salvador 21 2018 church_amb 7 El Salvador 22 2018 strong_amb_1 2 El Salvador 23 2017 church_amb 7 Guatemala 24 2019 church_amb 7 Guatemala 25 2016 church_amb 7 Honduras 26 2018 church_amb 7 Honduras 27 2017 church_amb 7 Jamaica 28 2019 church_amb 7 Jamaica 29 2016 church_amb 7 Mexico 30 2019 church_amb 7 Mexico 31 2016 church_amb 7 Nicaragua 32 2019 church_amb 7 Nicaragua 33 2019 threestate_amb 3 Nicaragua 34 2016 church_amb 7 Paraguay 35 2019 church_amb 7 Paraguay 36 2017 church_amb 7 Peru 37 2019 church_amb 7 Peru

fsolt commented 4 years ago

Closed by 1b4983c15ce48df956df74a069b919975bc63f12

fsolt commented 4 years ago

Oops, missed your comment. Let me look at that.

fsolt commented 4 years ago

It turns out that that data-raw/mood_dem.csv on the repo doesn't include those surveys (amb_dominicanrepublic2016, amb_dominicanrepublic2018, etc.), so they don't get included in claassen_input_raw. Commit your version?

fsolt commented 4 years ago

I'm going to go ahead and close #35, though, since https://github.com/fsolt/DCPOtools/commit/1b4983c15ce48df956df74a069b919975bc63f12 really did fix this particular issue.

Tyhcass commented 4 years ago

It turns out that that data-raw/mood_dem.csv on the repo doesn't include those surveys (amb_dominicanrepublic2016, amb_dominicanrepublic2018, etc.), so they don't get included in claassen_input_raw. Commit your version?

En,, actually, I didn't update mood_dem.csv. I used the same one in repo. These countries are not from amb_country, but from amb_comb. I guess, it is because I used the latest amb_comb in LAPOP web.

fsolt commented 4 years ago

How did I end up going around in circles on this? Per https://github.com/fsolt/DCPOtools/issues/28#issuecomment-638346625, I understood that file to have no data after 2014, but I see now those years are just like the earlier ones: incomplete. That doesn't answer the question why the later years don't show up now. Sigh. I'll dig.

fsolt commented 4 years ago

Yep, my fault for leaving the old copy of amb_combo around. Fixed in https://github.com/fsolt/dcpo_dem_mood/commit/fb33c4919cbcde7c02ac2f86b8bac35bb7c96812

fsolt commented 4 years ago

I found one more duplicate—Haiti 2016 is in amb_combo and had its own country file as well. Fixed in https://github.com/fsolt/dcpo_dem_mood/commit/5047fe22f06bfcf7c615861439effa4d1bf1d77c. We should be good to go now, @Tyhcass

Tyhcass commented 4 years ago

@fsolt I never thought we need to open this issue again........The thing is I got claassen_m5_2k_2020-06-21-15-40.rda via our claassen_input_raw1, HOWEVER, it was not converged. I checked our input data and Claassen's supdem raw survey marginals.csv. Then,,, I found that there were 2018 and 2019 in our column of year. And all of them are from the country_year which you updated.. They are not excluded via crosswalk.R. ........

Tyhcass commented 4 years ago

I should have double check country_year instead of only checking replication.

Tyhcass commented 4 years ago

@fsolt I am not sure where I should post the following problems since the installation and setup are solved, so post them there. format_dcpo can work well now. However, dcpo and dcpo_xvt cannot work in argon and my end. You are working on them, right?