Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

PSYCH-UA 11 Statistics and Data Analysis for Research in Psychology

Unstructured Report 2

Welcome to your second Unstructured Report! This assignment is another opportunity for you to apply the skills you've acquired in the course thus far. Instead of following a strict set of instructions, you will have the autonomy to choose and execute the analyses that you believe best fit the dataset.  This guide will provide you with a framework to help you navigate this task.

Introduction

In this assignment, you will be working with data from the World Bank. The World Bank is a tremendous source of global socio-economic data; spanning several decades and dozens of topics, it has the potential to shed light on numerous global issues. The wbstats R package provides access to this data.

The wbstats R-package allows researchers to quickly search and download the data of their particular interest in a programmatic and reproducible fashion. You can find A LOT of data with this package, and it’s easy to become overwhelmed. Thus, it is crucial that you select only a small subset  of the data to analyze by specifying the country and indicator codes that you want to download.

While not strictly required, I highly recommend that you visitthis and/or this link to learn in detail how to use the wbstats package.

Before using this dataset, you should install the wbstats package in R by typing:

> install.packages("wbstats")

Note that this command only needs to be executed once. To load the wbstats package in R:

> library(wbstats)

In contrast to install.packages(), you should execute library() whenever you start a new R session.

Your first step should be to familiarize yourself with the dataset, understanding the types of data it contains. Note that, while the dataset is very large, note that you are not required to analyze every data point. Instead, consider specific subsets that might be of interest (e.g., specific economic markers, specific countries, a limited range of years, etc.). Your choices of which subsets to focus on should be informed by the research questions you aim to answer.

In this second report, you should focus primarily on inferential statistics (estimation, hypothesis testing, linear models). However, this does not mean that you should not compute descriptive statistics or make graphs! Instead, you should use descriptive statistics and graphs as a way to explore the dataset and identify your research questions. It is also recommended that you present descriptive statistics and graphs alongside inferential statistics in your report, to orient the reader towards a particular aspect of the data.

Working with wbstats

Use the wb() function to request a particular component of the dataset. The only thing you need to get started is which indicator(s) you want to download and for what time period. The indicator parameter takes a vector of indicator IDs that correspond to the data you want to download. For example, to retrieve the “annual population growth” for all countries between 2005 and 2016, type:

library(wbstats

# Population growth (annual %)
pop_data <- wb(country = "countries_only", indicator = "SP.POP.GROW",
startdate = 2005, enddate = 2016)
head(pop_data)
## iso3c date value indicatorID indicator iso2c
## 1 ABW 2016 0.4599292 SP.POP.GROW Population growth (annual %) AW
## 2 ABW 2015 0.5246582 SP.POP.GROW Population growth (annual %) AW
## 3 ABW 2014 0.5874924 SP.POP.GROW Population growth (annual %) AW
## 4 ABW 2013 0.5929140 SP.POP.GROW Population growth (annual %) AW
## 5 ABW 2012 0.5121450 SP.POP.GROW Population growth (annual %) AW
## 6 ABW 2011 0.3769848 SP.POP.GROW Population growth (annual %) AW
## country
## 1 Aruba
## 2 Aruba
## 3 Aruba
## 4 Aruba
## 5 Aruba
## 6 Aruba

Here, the column “value” contains the actual population growth for the country indicated in “country”/” iso3c”/” iso2c” , and for the year indicated in “date” .

To retrieve both the annual population growth and GDP specifically for the United States and Norway, and specifically for year 1971, type:

pop_gdp_long <- wb(country = c("US", "NO"), indicator = c("SP.POP.GROW", "NY.GDP.MKTP.CD"), startdate = 1971, enddate = 1971)

head(pop_gdp_long)

##   iso3c date value indicatorID indicator

## 1   NOR 1971 7.012934e-01    SP.POP.GROW Population growth (annual %)

## 2   USA 1971 1.264334e+00    SP.POP.GROW Population growth (annual %)

## 3   NOR 1971 1.458311e+10 NY.GDP.MKTP.CD            GDP (current US$)

## 4   USA 1971 1.167770e+12 NY.GDP.MKTP.CD            GDP (current US$)

##   iso2c country

## 1    NO        Norway

## 2    US United States

## 3    NO        Norway

## 4    US United States

Again, each data point (combination of country, year, and indicator) is presented in a different row.

As these examples show, the wb() function enables the retrieval of different indicators. However, the indicators must be specified by its ID (e.g., "SP.POP.GROW" for population growth, or

"NY.GDP.MKTP.CD" for GDP). But how can we discover the indicator ID for a given indicator of interest? To do so, the function wbsearch allows you to search for indicators that match a certain term. For example, to search for indicators related to “ population growth” , type:

pop_vars <- wbsearch("Population Growth")

head(pop_vars)

##              indicatorID

indicator

## 4368         SP.URB.GROW Urban population

growth (annual %)

## 4382      SP.RUR.TOTL.ZG Rural population

growth (annual %)

## 4415         SP.POP.GROW Population

growth (annual %)

## 8825 IN.EC.POP.GRWTHRAT.   Decadal Growth

of Population (%)

As you can see, the ID “SP.POP.GROW”, representing the indicator “ Population growth (annual %)” , is displayed as an option. Similarly, to see a list of indicators related to unemployment, type:

pop_vars <- wbsearch("unemployment")

As before, once you identify a few indicators that you are interested in, take note of their indicator  IDs and retrieve the corresponding data using the wb() function. Once the data is retrieved, you are ready to start analyzing it!

Report Structure

Your report should be approximately 5 pages long and no longer than 10 pages. Please include the following sections:

1. Data Description:

Provide a succinct description of the World Bank dataset (based on the information shownhere, here, or elsewhere). Discuss its significance, and any relevant contextual information. Describe     also the specific subsets of the data you are analyzing and why.

2. Research Questions:

List 5 to 10 research questions you aim to address. These should be pertinent to your chosen dataset subset and the course's teachings. Remember that you should focus on statistical

inference. For instance, you might ask, "Was population growth greater in the 70’s than in the 80’s? ", or “does GDP tend to increase more in years of steepest population growth, in

comparison to years of weak population growth?”

3. Analyses:

For each analysis, adhere to the following structure:

.     Objective: Clearly state your goal (e.g., “I will compare the population means of group A and group B”).

.     R  Code:  Present your R code, ensuring it's well-formatted and includes comments. This will make it easier for others (and future you!) to understand.

.     Output:  Display the results from your R code (e.g., R output, or a graph).

.     Interpretation:  Elucidate what you've found. For statistical tests, report findings in full APA style.

4. Conclusion:

Summarize your main findings in 1-3 paragraphs, discussing primary results and their   implications. What insights have you drawn from your analyses? What are the broader implications of these insights?

Academic Integrity

You're encouraged to consult course materials and the internet. However, the work you submit

should be entirely your own, including analyses, R code, figures, and interpretations. Collaboration with peers isn't forbidden, but if you do consult with others, you must mention their full names in your report and the nature of the information exchanged. Above all, ensure your report is

authentically yours and free from any copied components.

The use of Large Language Models (e.g., chatGPT) is discouraged. If you end up using it, please   make sure to mention the source (e.g., chatGPT) in your report and the nature of the information retrieved from it.

Grading Rubric

Your assignment will be evaluated based on the following criteria:

.     Selection of Research Questions & Analyses (25%): Have you chosen pertinent and   thought-provoking questions? Are the analyses you've selected apt for these questions?

.     Correctness of the Analyses  (25%): Is your R code accurate? Have you included comprehensive comments?

.     Interpretation & Conclusions (25%): Are your interpretations and conclusions aligned with your findings? Have you presented hypothesis testing results in APA style where applicable?

.     Quality of the  Report (25%): Have you included all four sections? Is your paper well- organized, clearly written, and polished?

Remember, while the course materials provide a foundation, you have the freedom to explore beyond. We're excited to see where your curiosity and analytical skills take you!