-
Notifications
You must be signed in to change notification settings - Fork 0
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
Comments: R file #2
Comments
First of all: Thanks for the extensive comments on my file, especially the highlighting of errors in the order of subsetting / merging. Some clarifications regarding my steps:
I agree that this is a real downside of the variable. I did this because I didn't find any way of calculating the number of preceding terms for each row in the data set. I remember you telling me that Christopher added such functionality into his DataCombine package after you discussed this bilaterally. Could you please share the code which you used to create term variable using the GitHub version of DataCombine on here or in a GitHub Gist with me, so I could include it into our R source file?
As I didn't convert the date strings into R's date format using lubridate, I extracted the year numbers from the date string and coerced them into an integer to be used in the subsetting. While this might not be the most parsimonious way of doing it, I'll leave it "as is" as it should suffice for our analysis, which is conducted on the year-level.
You're absolutely right about this. Thanks for highlighting this issue. I have rearranged my code for creating the Reelection variable and all the lagged dependent variables after the subsetting of the data set and order the data prior to merging.
I have excluded those elections which are coded "3" for ElectionType. This excludes all first rounds where run-offs were necessary and instead uses the result of the run-off election for the year under scrutiny. While this probably overstates the margin by which the candidate won, I see this to be better than the danger of falsely declaring those candidates winners, who were leading in the first round but who lost in the run-offs.
Once again, thanks for the feedback. Your expertise with the data set is really showing here. |
Very quickly: Here is the data code that I used for the term number of mayors. It takes quite some time though to run:
|
Hi Malte, here my comments on the R file:
These are my first comments on the R file. Hope that is helpful for your next steps!
The text was updated successfully, but these errors were encountered: