Stat.474 Quiz 1

Author

<<< Put your name here >>>

Instructions:

Complete the questions in the space provided. Render the Quarto Notebook to a .docx or .pdf file and submit your .qmd and your .docx or .pdf file through Canvas.

The quiz investigate the dataset global_economy. The dataset contains yearly historical economic data for all countries on Earth.

library(pacman)
p_load(tidyverse, fpp3)

Question 1

How many countries are there on Earth? (You should look this number up on Google or on Wikipedia.) How may Countries are there in the dataset? Why do the numbers differ?

Answer

<<< Write your answer here. >>>

Provide your code here.

data(global_economy)
global_economy
# A tsibble: 15,150 x 9 [1Y]
# Key:       Country [263]
   Country     Code   Year         GDP Growth   CPI Imports Exports Population
   <fct>       <fct> <dbl>       <dbl>  <dbl> <dbl>   <dbl>   <dbl>      <dbl>
 1 Afghanistan AFG    1960  537777811.     NA    NA    7.02    4.13    8996351
 2 Afghanistan AFG    1961  548888896.     NA    NA    8.10    4.45    9166764
 3 Afghanistan AFG    1962  546666678.     NA    NA    9.35    4.88    9345868
 4 Afghanistan AFG    1963  751111191.     NA    NA   16.9     9.17    9533954
 5 Afghanistan AFG    1964  800000044.     NA    NA   18.1     8.89    9731361
 6 Afghanistan AFG    1965 1006666638.     NA    NA   21.4    11.3     9938414
 7 Afghanistan AFG    1966 1399999967.     NA    NA   18.6     8.57   10152331
 8 Afghanistan AFG    1967 1673333418.     NA    NA   14.2     6.77   10372630
 9 Afghanistan AFG    1968 1373333367.     NA    NA   15.2     8.90   10604346
10 Afghanistan AFG    1969 1408888922.     NA    NA   15.0    10.1    10854428
# … with 15,140 more rows
global_economy %>% distinct(Country) 
# A tibble: 263 × 1
   Country            
   <fct>              
 1 Afghanistan        
 2 Albania            
 3 Algeria            
 4 American Samoa     
 5 Andorra            
 6 Angola             
 7 Antigua and Barbuda
 8 Arab World         
 9 Argentina          
10 Armenia            
# … with 253 more rows

Question 2

Create a new variable GDP_per_capita. Show the first few values of the new variable.

Answer

<<< Write your answer here. >>>

Provide your code here.

Question 3

Plot the time series data for Population for each of these countries: United States, Brasil, Canada, Mexico, Russia, Israel, and Japan. What do you notice about the population of Russian and Japan?

Answer

<<< Write your answer here. >>>

Provide your code here.

Question 4

Plot the time series data for GDP for each of these countries: United States, Brasil, Canada, Mexico, Russia, Israel, and Japan. How does the GDP of Japan compare to the GDP of the United States?

Answer

<<< Write your answer here. >>>

Provide your code here.

Question 5

Plot the time series data for GDP_per_capita for each of these countries: United States, Brasil, Canada, Mexico, Russia, Israel, and Japan. How does the GDP per capita differ for Russia, Mexico and Brasil?

Answer

<<< Write your answer here. >>>

Provide your code here.

Question 6

Remake all of your plots including China. How does China compare to the United States in each plot?

Answer

<<< Write your answer here. >>>

Provide your code here.

Question 7

Does it make sense to run a Seasonal Decomposition with these data? Why or why not, explain.

Answer

<<< Write your answer here. >>>

Question 8

R questions.

  1. Explain what a tsibble is?

<<< Write your answer here. >>>

  1. Explain what a mable is?

<<< Write your answer here. >>>

  1. Explain what a fable is?

<<< Write your answer here. >>>