  Past research has studied social determinants of attitudes toward foreign
countries. Confounded by potential endogeneity biases due to unobserved factors
or reverse causality, the causal impact of these factors on public opinion is
usually difficult to establish. Using social media data, we leverage the
suddenness of the COVID-19 pandemic to examine whether a major global event has
causally changed American views of another country. We collate a database of
more than 297 million posts on the social media platform Twitter about China or
COVID-19 up to June 2020, and we treat tweeting about COVID-19 as a proxy for
individual awareness of COVID-19. Using regression discontinuity and
difference-in-difference estimation, we find that awareness of COVID-19 causes
a sharp rise in anti-China attitudes. Our work has implications for
understanding how self-interest affects policy preference and how Americans
view migrant communities.
