Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E04: Nonexistent files #97

Open
martonfleck opened this issue Nov 19, 2020 · 2 comments
Open

E04: Nonexistent files #97

martonfleck opened this issue Nov 19, 2020 · 2 comments

Comments

@martonfleck
Copy link

martonfleck commented Nov 19, 2020

The Merge part of Episode 04 works with files data/wdi_decades.dta and data/average_distance.dta. There are no such files in the data folder, and they are not created in previous episodes either.

Generating these datasets would fit into Episode 03 to illustrate and practice egen and collapse.

@csokaimola
Copy link

I also noticed this problem. Same as in #72 . @korenmiklos where do these data come from?

@csokaimola
Copy link

csokaimola commented Aug 15, 2024

Solutions:

wdi_decades.dta --> one line of code can be included in Episode 4, after the append

  • Append
    use "data/derived/gdp1990.dta", clear
    generate year = 1990
    append using "data/derived/gdp1991.dta"
    replace year = 1991 if missing(year)
    append using "data/derived/gdp1992.dta"
    replace year = 1992 if missing(year)
    save data/wdi_decades.dta, replace // this line needs to be added to generate the wdi_decades.dta that we use later in merge. But the naming does not make much sense, since no decade data here...

average_distance.dta --> can be included in Episode 3 as an example for collapse, I suggest to include it as a challenge at the end, right before the opional part (keep if inlist(countrycode, "EMU", "WLD") ...), the following way:

  • Additional challenge: create the average of simple distances between capitals by country, using collapse. Save it in data/average_distance.dta, we will need it in a later exercise in Episode 4.
    use "data/raw/cepii/dist_cepii.dta", clear
    collapse (mean) average_distance=dist, by(iso_o)
    save "data/average_distance.dta", replace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants