Question: Warning: Any code not covered in the lab sessions will not be accepted! AI - generated code will NOT be graded! ( You are ONLY
Warning: Any code not covered in the lab sessions will not be accepted! AIgenerated code will NOT be graded! You are ONLY allowed to use AI for debugging errors in your code
Question :
We will use the 'countries.csv dataset. You can find this data in the lab materials folder.
Let's explore the level of democracy. Create a summary table for the demlevel variable.
Requirements:
a The column names for the newly created data frame will be 'RegimeType' and 'Count' respectively.
b The count variable must have an ascending order.
c display the data frame the summary data you just created in the tabular format
Question :
Create a horizontal bar chart for the demlevel variable.
Requirements:
a Set the title to 'Regime Type Distribution'. The Xaxis label is 'Regime Type' and the Yaxis label is 'Count'.
b Adjust the code so that the heights of the bars are ordered.
Question :
Create a percentage pie chart for demlevel
Note: You will use the summary table you created for question
Requirements:
a Add a new 'percentage' column based on the 'Count' to that table.
b To make the edges proportional set yCount in the aes function of ggplot.
Question :
Choose two relevant variables from the dataset and create a scatter plot. Interpret the graph briefly.
Question :
Create a histogram OR a kernel density plot for the gdppcapGDP per capita of countries in variable AND interpret the graph.
Question :
Create a pivot table in which data is grouped by the demlevel variable and summarized by mean and standard deviation of gdppcaphint: lines in Lab
Requirements:
a To get rid of NA values, you will need to add the narmTRUE argument into the mean and sd functions eg meanvariablename, narmTRUE
b Display the pivot table AND interpret the results briefly What do we learn from this table?
Please help me to answer this question.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
