Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Each line of code must be annotated. Questions: Researchers have theorized that natural resources may have an inhibiting effect on the democratization process. Although there are multiple explanations...

1 answer below »
Each line of code must be annotated.

Questions: Researchers have theorized that natural resources may have an inhibiting effect on the democratization process. Although there are multiple explanations as to why this might be the case, one hypothesis posits that governments in countries with large natural resource endowments (like oil) are able to fund their operations without taxing civilians. Since representation (and other democratic institutions) are a compromise offered by governments in exchange for tax revenue, resource-rich countries do not need to make this trade. In this exercise, we will not investigate causal effects of oil on democracy. Instead, we examine whether the association between oil and democracy is consistent with the aforementioned hypothesis.
This exercise is in part based on Michael L. Ross. (2001). ‘Does Oil Hinder Democracy?’ World Politics,53:3,
pp XXXXXXXXXX.
The data set is in the csv file resources.csv. The names and descriptions of variables are:
Name Description
cty_name Country name
year Year
logGDPcp Logged GDP per capita
regime A measure of a country’s level of democracy: -10 (authoritarian) to 10
(democratic)
oil Amount of oil exports as a percentage of the country’s GDP
metal Amount of non-fuel mineral exports as a percentage of the country’s GDP
illit Percentage of the population that is illiterate
life Life expectancy in the country

Question 2 (3 points)We focus on the following subset of the variables: regime, oil, logGDPcp, and illit. Remove observations
that have missing values in any of these variables (Hint: na.omit can be of great help here). Fit the k-means
clustering algorithm with two clusters. How many observations are assigned to each cluster? Based on the
means (centers) of these variables in each cluster, describe the differences you observe across clusters.
Question 3 (4 points)
Using data and the clusters from Question 2, produce a scatterplot between logged GDP per capita and
illiteracy rate. Use different colors for the clusters so that we can easily tell the cluster membership of each
observation. Briefly comment on the results.

Bonus question (1 point)Repeat the Questions 2 and 3 (coding component) but this time with three clusters instead of two. How are
the results different? Which clustering model would you prefer and why?
My code:

resources Desktop\\QPM\\resources.csv")q2sub logGDPcp", "illit")))
q2sub$cluster
table(q2sub$cluster, exclude = NULL)
Answered Same Day Nov 03, 2021

Solution

Vignesh answered on Nov 03 2021
134 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here