── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.3 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ ggplot2 3.4.3 ✔ tibble 3.2.1
✔ lubridate 1.9.2 ✔ tidyr 1.3.0
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)library(reshape2)
Attaching package: 'reshape2'
The following object is masked from 'package:tidyr':
smiths
library(dplyr)library(kableExtra)
Attaching package: 'kableExtra'
The following object is masked from 'package:dplyr':
group_rows
Background
The PISA is an international standardized test used by many countries around the world. When reports say the US is doing poorly in math compared to other countries, particularly China, the PISA is the test that information is referring to. Since 2000, the PISA has collected and shared its data and findings and I will look into this data in the following graphs.
PISA2012<-read_excel("PISA2012.xls", range ="A3:D72")
New names:
• `` -> `...3`
PISA2015<-read_excel("PISA2015.xls", range ="A3:D77")
New names:
• `` -> `...3`
PISAALL<-read_excel("PISAALL.xls", range ="B12:G285")
PISA2012<-PISA2012|>rename('Average Math Score.12'='Average score')|>mutate(`Average Math Score.12`=round(`Average Math Score.12`, 2))|>mutate(`Standard Error`=round(`Standard Error`, 2))print(PISA2012)
# A tibble: 69 × 3
`Education system` `Average Math Score.12` `Standard Error`
<chr> <dbl> <dbl>
1 OECD average 494. 0.49
2 Shanghai-China 613. 3.29
3 Singapore 573. 1.32
4 Hong Kong-China 561. 3.22
5 Chinese Taipei 560. 3.3
6 Korea, Republic of 554. 4.58
7 Macao-China 538. 0.96
8 Japan 536. 3.59
9 Liechtenstein 535. 3.95
10 Switzerland 531. 3.04
# ℹ 59 more rows
PISA2015<- PISA2015 |>rename('Average Math Score.15'="Average score")|>rename('Standard Error'="s.e.")|>mutate(`Average Math Score.15`=round(`Average Math Score.15`, 2))|>mutate(`Standard Error`=round(`Standard Error`, 2))|>select(-3)print(PISA2015)
# A tibble: 74 × 3
`Education system` `Average Math Score.15` `Standard Error`
<chr> <dbl> <dbl>
1 OECD average 490. 0.44
2 Singapore 564. 1.47
3 Hong Kong-China 548. 2.98
4 Macao-China 544. 1.11
5 Chinese Taipei 542. 3.03
6 Japan 532. 3
7 B-S-J-G (China) 531. 4.89
8 Korea, Republic of 524. 3.71
9 Switzerland 521. 2.92
10 Estonia 520. 2.04
# ℹ 64 more rows
Merge Data
PISA2012merge <- PISA2012[, c('Education system', 'Average Math Score.12')]PISA2015merge <- PISA2015[, c('Education system', 'Average Math Score.15')]merged_data <- PISA2012merge %>%left_join(PISA2015merge, by ="Education system")merged_data <- merged_data %>%mutate(Averagediff =`Average Math Score.15`-`Average Math Score.12`)print(merged_data)
# A tibble: 69 × 4
`Education system` `Average Math Score.12` Average Math Score.1…¹ Averagediff
<chr> <dbl> <dbl> <dbl>
1 OECD average 494. 490. -3.84
2 Shanghai-China 613. NA NA
3 Singapore 573. 564. -9.28
4 Hong Kong-China 561. 548. -13.3
5 Chinese Taipei 560. 542. -17.5
6 Korea, Republic of 554. 524. -29.7
7 Macao-China 538. 544. 5.68
8 Japan 536. 532. -3.97
9 Liechtenstein 535. NA NA
10 Switzerland 531. 521. -9.68
# ℹ 59 more rows
# ℹ abbreviated name: ¹`Average Math Score.15`
ggplot(data = merged_data, aes(x =`Average Math Score.12`, y =`Average Math Score.15`)) +geom_point(aes(color = Averagediff)) +labs(title ="Scatter Plot of Average Math Scores",x ="Average Math Score 2012",y ="Average Math Score 2015",color ="Average Difference in Scores" )
cor(merged_data$`Average Math Score.12`,merged_data$`Average Math Score.15`)
[1] 0.9657837
meandiff<-mean(merged_data$Averagediff)
Given the correlation between the average math score in 2012 and 2015 is .966, that shows how reliable the PISA test is. With only three years separating the testing, there should not be abundant movement expected within a single country/education system. Therefore the fact that the 2012 scores are a strong indicator of the 2015 scores shows the test does a consistent job of capturing the abilities of the participants. The average difference between 2012 and 2015 test scores was only -1.43. That means countries did better on the 2012 test by about 1.5 points which on a scale that goes beyond 550 points, that is a minuscule difference. That being said there were some countries that had more significant changes. The country with the biggest difference was Argentina. Argentina did better o the 2015 PISA math section by 68 points. The next biggest change was in the country of Qatar that went up by 26 points. Those countries are represented by the lightest shades of blue on the graph. On the other end, Korea and Turkey had the greatest negative change, doing better in 2012 by 30 and 28 points respectively. Those dots are represented by the darkest shade of blue on the graph.
Now let’s compare education systems across a wider range of years
PISA 2003-2022
Clean Data
PISAALL_INT <- PISAALL |>filter(Jurisdiction =='International Average (OECD)') |>mutate(Average =as.numeric(Average), Average =round(Average, 2))PISAALL_INT <- PISAALL_INT |>select(Jurisdiction, `Year/Study`, Average) |>rename(Jurisdiction = Jurisdiction, Year_Study =`Year/Study`, Average = Average)
Plot Trend
library(ggplot2)ggplot(data = PISAALL_INT, mapping=aes(x = Year_Study, y = Average)) +geom_point()+geom_smooth(method ="lm")+labs(title ="Scatter Plot of PISA International Average Math Scores",x ="Year",y ="Average Math Score" )
`geom_smooth()` using formula = 'y ~ x'
Overall since 2003 there has been a decrease in International Average math scores. In 2003 the average math score peaked at 500 points. Between the years of 2006 and 2018 the average score stayed within a range of 7 points averaging at around 485 points. Then in 2022 the average math score dropped by 15 points down to 472. This extreme decline in scores can be attributed to the pandemic which impacted all nations and unfortunately academic test scores suffered. The decrease in test scores in 2006 is not as apparent as the decrease caused by the pandemic. There are many factors that could account for a 10 point decrease between testing years. The countries that participated have changed throughout the years and as more countries joined between 2003 and 2006, the average was brought down.