Skip to content

Comments: R file #2

@jmarkgraf

Description

@jmarkgraf

Hi Malte, here my comments on the R file:

  • variable "TotalTerms" (line 82-86): variable does not tell us whether it is mayor's first term or maybe already her fifth term; this, however, is crucial as we presume that re-election is more likely the more terms the incumbent has served as a mayor.
  • variable "Year" (line 88-89): what is the value added of this variable?
  • variable "Reelection" (line 97-103): our dataset is not ordered by municipality ID, but by incumbent name, which leads to a wrong estimation - you need to order it by IDMunicipality (1st order) and election year (2nd order) before you do the steps (this is a problem for all further slides you do!!); furthermore, you need to first exclude 1 round of the runoff election (either the 1st round that led to the runoff or the 2nd round, which is the outcome of the runoff election)
  • subsetting for time period (line 114-116): a more elegant way to do this is to use the lubridate package, followed by a command like MayorElection$ElectionDate <- ymd(MayorElection$ElectionDate); subsetting is more parsimonious with MayorElection <- subset(x = MayorElection, ElectionDate > "2006-01-01") (for all three subsetting steps). But your way works too!
  • subsetting for runoffs (line 118-120): as mentioned above, this comes too late as you already slided everything.
  • merging datasets (line 130-137): you need to do that before you subset; otherwise you exclude non-contested elections before you slide the board membership info.
  • other aspects:
    • you might want to slide the gender variable, too.
    • you need to slide the vote share variable of the winner.

These are my first comments on the R file. Hope that is helpful for your next steps!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions