Computer Science Access in U.S. High Schools: Trends, State Differences, and North Carolina

ECI 586 Intro to Learning Analytics

Author

Jimmy Strickland

Published

November 19, 2026

1. PREPARE

1a. Background and Purpose

Computer science has become an important part of education as programming, data science, cybersecurity, artificial intelligence, and other technologies continue to influence school, work, and everyday life. High school computer science courses can introduce students to computational thinking, programming, problem-solving, and possible college and career pathways. However, those opportunities are not necessarily available at every school or equally distributed across states.

This case study examines access to foundational computer science education in U.S. high schools. Rather than examining individual student achievement, this analysis focuses on whether high schools provide students with access to qualifying foundational computer science courses.

Students cannot participate in formal computer science education if their schools do not offer qualifying courses. At the same time, simply offering a course does not tell us whether students actually enroll, whether the course is high quality, or how much students learn. Therefore, this project focuses specifically on availability and access while recognizing that access is only one part of computer science education.

This project is guided by three research questions:

  1. How has access to foundational computer science courses changed over time in the United States?

  2. Which states experienced the largest increases or decreases in access to foundational computer science between 2019–2020 and 2023–2024?

  3. How does North Carolina’s access to foundational computer science compare with the national trend?

The primary audience for this analysis includes educators, school administrators, state education leaders, and policymakers. Understanding where access to computer science has increased or remained limited may help these groups identify areas that deserve additional attention or further investigation.

1b. Data Source

The data used for this case study come from Code.org’s 2025 State of AI + Computer Science Education public data (Code.org, 2025).

The workbook used for the analysis is titled:

High School 2025 Data (Public)

The workbook contains several worksheets covering different aspects of high school computer science education, including access over time, geographic differences, school-size differences, participation, student demographic groups, and graduation information.

For this project, the primary worksheet is:

Access Percent over the Years

The worksheet contains state-level access percentages across seven school years and notes that data are not available for every state in every year.

The seven school years represented are 2018–2019 through 2024–2025.

The primary variables used in this project are state, school year, and percent access. Percent access represents the percentage of high schools reported as offering foundational computer science.

Code.org describes foundational computer science as a subset of all computer science courses. Its published methodology states that qualifying high school courses are offered during the school day and include at least 20 hours of programming. This helps distinguish foundational computer science from general technology literacy or courses focused mainly on using computer applications.

The workbook also contains a worksheet called Most Recent Access Data. That worksheet indicates that access information may come from sources such as state education agencies, school course catalogs, and teacher surveys. Because this case study focuses on change over time, I did not merge that worksheet into the main analysis. I used it only to understand better how the underlying access measures were assembled.

1c. Load Packages

The analysis uses the tidyverse and readxl packages.

The readxl package is used to import Excel workbooks, while the tidyverse provides functions for cleaning, transforming, summarizing, and visualizing data.

library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.5.3
Warning: package 'ggplot2' was built under R version 4.5.3
Warning: package 'tibble' was built under R version 4.5.3
Warning: package 'purrr' was built under R version 4.5.3
Warning: package 'stringr' was built under R version 4.5.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.6.0
✔ ggplot2   4.0.2     ✔ tibble    3.3.1
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.2.1     
── 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)

1d. Import the Data

The Excel workbook is stored locally in my Documents folder. The first two rows of the Access Percent over the Years worksheet contain a description and a blank row, so the actual variable names begin on the third row. I therefore used skip = 2 when importing the worksheet. The spreadsheet also uses a dash to represent unavailable information, so I specified “-” and “N/A” as missing values during import.

file_path <- "C:/Users/jimmy/Documents/High School 2025 Data (Public).xlsx"

cs_raw <- read_excel(
  file_path,
  sheet = "Access Percent over the Years",
  skip = 2,
  na = c("-", "N/A")
)
New names:
• `` -> `...1`
cs_raw
# A tibble: 55 × 8
   ...1      `2018–2019 % Access` `2019–2020 % Access` `2020–2021 % Access`
   <chr>                    <dbl>                <dbl>                <dbl>
 1 National*                 0.45                 0.47                 0.51
 2 AL                        0.49                 0.57                 0.82
 3 AK                        0.19                 0.32                 0.42
 4 AZ                       NA                    0.38                 0.36
 5 AR                        0.78                 0.89                 0.92
 6 CA                        0.4                 NA                   NA   
 7 CO                       NA                   NA                    0.57
 8 CT                        0.67                 0.82                 0.77
 9 DE                        0.65                 0.68                 0.55
10 DC                        0.2                  0.41                 0.37
# ℹ 45 more rows
# ℹ 4 more variables: `2021–2022 % Access` <dbl>, `2022–2023 % Access` <dbl>,
#   `2023–2024 % Access` <dbl>, `2024–2025 % Access` <dbl>

Before cleaning the data, I inspected its structure and variable names.

head(cs_raw)
# A tibble: 6 × 8
  ...1      `2018–2019 % Access` `2019–2020 % Access` `2020–2021 % Access`
  <chr>                    <dbl>                <dbl>                <dbl>
1 National*                 0.45                 0.47                 0.51
2 AL                        0.49                 0.57                 0.82
3 AK                        0.19                 0.32                 0.42
4 AZ                       NA                    0.38                 0.36
5 AR                        0.78                 0.89                 0.92
6 CA                        0.4                 NA                   NA   
# ℹ 4 more variables: `2021–2022 % Access` <dbl>, `2022–2023 % Access` <dbl>,
#   `2023–2024 % Access` <dbl>, `2024–2025 % Access` <dbl>
glimpse(cs_raw)
Rows: 55
Columns: 8
$ ...1                 <chr> "National*", "AL", "AK", "AZ", "AR", "CA", "CO", …
$ `2018–2019 % Access` <dbl> 0.45, 0.49, 0.19, NA, 0.78, 0.40, NA, 0.67, 0.65,…
$ `2019–2020 % Access` <dbl> 0.47, 0.57, 0.32, 0.38, 0.89, NA, NA, 0.82, 0.68,…
$ `2020–2021 % Access` <dbl> 0.51, 0.82, 0.42, 0.36, 0.92, NA, 0.57, 0.77, 0.5…
$ `2021–2022 % Access` <dbl> 0.53, 0.85, 0.51, NA, 0.92, NA, 0.54, 0.84, 0.40,…
$ `2022–2023 % Access` <dbl> 0.5770000, 0.9500000, NA, NA, 0.9900000, 0.450000…
$ `2023–2024 % Access` <dbl> 0.6000000, 0.9419525, NA, 0.4323484, 1.0000000, 0…
$ `2024–2025 % Access` <dbl> 0.6000000, 0.9188482, 0.3423077, NA, 1.0000000, 0…
colnames(cs_raw)
[1] "...1"               "2018–2019 % Access" "2019–2020 % Access"
[4] "2020–2021 % Access" "2021–2022 % Access" "2022–2023 % Access"
[7] "2023–2024 % Access" "2024–2025 % Access"

This inspection confirmed that the correct worksheet was imported and helped identify the variable types, missing values, and unusual labels that needed to be addressed during cleaning.

The first column contains state abbreviations. The data also include labels such as National*, which correspond to notes included at the bottom of the original spreadsheet.

2. WRANGLE

During the wrangling stage, I transformed the original spreadsheet into a clean dataset where each row represents one location during one school year. Several preprocessing steps were necessary before the data could be analyzed.

2a. Rename the State Variable

The first column contains either a state abbreviation or the national value. I renamed this variable to state so its meaning is clear throughout the analysis.

names(cs_raw)[1] <- "state"

head(cs_raw)
# A tibble: 6 × 8
  state     `2018–2019 % Access` `2019–2020 % Access` `2020–2021 % Access`
  <chr>                    <dbl>                <dbl>                <dbl>
1 National*                 0.45                 0.47                 0.51
2 AL                        0.49                 0.57                 0.82
3 AK                        0.19                 0.32                 0.42
4 AZ                       NA                    0.38                 0.36
5 AR                        0.78                 0.89                 0.92
6 CA                        0.4                 NA                   NA   
# ℹ 4 more variables: `2021–2022 % Access` <dbl>, `2022–2023 % Access` <dbl>,
#   `2023–2024 % Access` <dbl>, `2024–2025 % Access` <dbl>

2b. Remove Footnotes and Non-Data Rows

The original worksheet contains explanatory notes below the state observations. Because these notes are documentation rather than actual observations, I first removed the asterisks from the state labels.

cs_clean <- cs_raw |>
  mutate(
    state = str_remove_all(state, "\\*")
  )

I then kept only the national observation, the 50 state abbreviations, and Washington, D.C.

cs_clean <- cs_clean |>
  filter(
    state == "National" |
      state %in% c(state.abb, "DC")
  )

cs_clean
# A tibble: 52 × 8
   state    `2018–2019 % Access` `2019–2020 % Access` `2020–2021 % Access`
   <chr>                   <dbl>                <dbl>                <dbl>
 1 National                 0.45                 0.47                 0.51
 2 AL                       0.49                 0.57                 0.82
 3 AK                       0.19                 0.32                 0.42
 4 AZ                      NA                    0.38                 0.36
 5 AR                       0.78                 0.89                 0.92
 6 CA                       0.4                 NA                   NA   
 7 CO                      NA                   NA                    0.57
 8 CT                       0.67                 0.82                 0.77
 9 DE                       0.65                 0.68                 0.55
10 DC                       0.2                  0.41                 0.37
# ℹ 42 more rows
# ℹ 4 more variables: `2021–2022 % Access` <dbl>, `2022–2023 % Access` <dbl>,
#   `2023–2024 % Access` <dbl>, `2024–2025 % Access` <dbl>

This prevented the explanatory text at the bottom of the worksheet from being included in calculations or graphs.

2c. Reshape the Dataset

A long format is more useful for this analysis because it allows the same variables to be used across multiple school years. I used pivot_longer() to reshape the dataset from wide to long format.

cs_long <- cs_clean |>
  pivot_longer(
    cols = contains("% Access"),
    names_to = "school_year",
    values_to = "access"
  )

cs_long
# A tibble: 364 × 3
   state    school_year        access
   <chr>    <chr>               <dbl>
 1 National 2018–2019 % Access  0.45 
 2 National 2019–2020 % Access  0.47 
 3 National 2020–2021 % Access  0.51 
 4 National 2021–2022 % Access  0.53 
 5 National 2022–2023 % Access  0.577
 6 National 2023–2024 % Access  0.6  
 7 National 2024–2025 % Access  0.6  
 8 AL       2018–2019 % Access  0.49 
 9 AL       2019–2020 % Access  0.57 
10 AL       2020–2021 % Access  0.82 
# ℹ 354 more rows

The new school_year variable identifies the year, while access contains the corresponding access value.

I then removed the unnecessary % Access text from the year labels.

cs_long <- cs_long |>
  mutate(
    school_year = str_remove(
      school_year,
      " % Access"
    )
  )
head(cs_long)
# A tibble: 6 × 3
  state    school_year access
  <chr>    <chr>        <dbl>
1 National 2018–2019    0.45 
2 National 2019–2020    0.47 
3 National 2020–2021    0.51 
4 National 2021–2022    0.53 
5 National 2022–2023    0.577
6 National 2023–2024    0.6  

2d. Convert Access Values to Percentages

The percentages in the Excel workbook are stored as proportions. I multiplied the values by 100 so they could be interpreted directly as percentages.

cs_long <- cs_long |>
  mutate(
    access = access * 100
  )

head(cs_long)
# A tibble: 6 × 3
  state    school_year access
  <chr>    <chr>        <dbl>
1 National 2018–2019     45  
2 National 2019–2020     47  
3 National 2020–2021     51  
4 National 2021–2022     53  
5 National 2022–2023     57.7
6 National 2023–2024     60  

After this transformation, an access value can be interpreted directly as the approximate percentage of high schools offering foundational computer science.

2e. Order the School Years

Because school_year was stored as text, I converted it to a factor with the levels arranged in chronological order so R would display the years correctly.

This transformation was especially important for the line charts showing change over time.

cs_long <- cs_long |>
  mutate(
    school_year = factor(
      school_year,
      levels = c(
        "2018–2019",
        "2019–2020",
        "2020–2021",
        "2021–2022",
        "2022–2023",
        "2023–2024",
        "2024–2025"
      )
    )
  )

cs_long
# A tibble: 364 × 3
   state    school_year access
   <chr>    <fct>        <dbl>
 1 National 2018–2019     45  
 2 National 2019–2020     47  
 3 National 2020–2021     51  
 4 National 2021–2022     53  
 5 National 2022–2023     57.7
 6 National 2023–2024     60  
 7 National 2024–2025     60  
 8 AL       2018–2019     49  
 9 AL       2019–2020     57  
10 AL       2020–2021     82  
# ℹ 354 more rows

2f. Examine Missing Data

Missing data are important in this dataset because not every state has a reported value for every school year. I counted the number of state or D.C. observations available in each year to understand how reporting coverage changed over time.

reporting_by_year <- cs_long |>
  filter(state != "National") |>
  group_by(school_year) |>
  summarize(
    states_reporting = sum(!is.na(access))
  )

reporting_by_year
# A tibble: 7 × 2
  school_year states_reporting
  <fct>                  <int>
1 2018–2019                 40
2 2019–2020                 47
3 2020–2021                 48
4 2021–2022                 48
5 2022–2023                 43
6 2023–2024                 50
7 2024–2025                 24

The following bar chart shows the differences in reporting coverage across school years.

ggplot(
  reporting_by_year,
  aes(
    x = school_year,
    y = states_reporting
  )
) +
  geom_bar(
    stat = "identity"
  ) +
  labs(
    title = "State-Level Data Availability by School Year",
    subtitle = "Number of states or D.C. with a reported access value",
    x = "School Year",
    y = "Number of State/DC Observations"
  ) +
  theme_minimal() +
  theme(
    axis.text.x = element_text(
      angle = 45,
      hjust = 1
    )
  )

Although the workbook includes a 2024–2025 column, only 24 states or D.C. have a reported value for that year. Using 2024–2025 for the main cross-state comparison would therefore exclude more than half of the possible state-level observations. I instead used 2023–2024, which contains 50 state and DC observations and is missing only Alaska. I still used 2024–2025 when examining the national trend and North Carolina because both have reported values for that year. This approach reduces the effect of missing data on the state comparison.

2g. Create a State Change Variable

The second research question focuses on which states experienced increases or decreases in access.

For this comparison, I used 2019–2020 as the starting year and 2023–2024 as the ending year.

I selected these years because 2019–2020 has substantially more state coverage than 2018–2019, while 2023–2024 has much more complete coverage than 2024–2025.

First, I filtered the data to the two comparison years.

change_data <- cs_long |>
  filter(
    state != "National",
    school_year %in% c(
      "2019–2020",
      "2023–2024"
    )
  ) |>
  select(
    state,
    school_year,
    access
  )

change_data
# A tibble: 102 × 3
   state school_year access
   <chr> <fct>        <dbl>
 1 AL    2019–2020     57  
 2 AL    2023–2024     94.2
 3 AK    2019–2020     32  
 4 AK    2023–2024     NA  
 5 AZ    2019–2020     38  
 6 AZ    2023–2024     43.2
 7 AR    2019–2020     89  
 8 AR    2023–2024    100  
 9 CA    2019–2020     NA  
10 CA    2023–2024     51.7
# ℹ 92 more rows

I then used pivot_wider() so that each state’s starting and ending access values appeared on the same row.

change_data <- change_data |>
  pivot_wider(
    names_from = school_year,
    values_from = access
  )

change_data
# A tibble: 51 × 3
   state `2019–2020` `2023–2024`
   <chr>       <dbl>       <dbl>
 1 AL             57        94.2
 2 AK             32        NA  
 3 AZ             38        43.2
 4 AR             89       100  
 5 CA             NA        51.7
 6 CO             NA        66.3
 7 CT             82        83.6
 8 DE             68        61.4
 9 DC             41        53.5
10 FL             33        38.4
# ℹ 41 more rows

States missing either the 2019–2020 or 2023–2024 value were excluded from the change analysis.

change_data <- change_data |>
  filter(
    !is.na(`2019–2020`),
    !is.na(`2023–2024`)
  )
change_data
# A tibble: 46 × 3
   state `2019–2020` `2023–2024`
   <chr>       <dbl>       <dbl>
 1 AL             57        94.2
 2 AZ             38        43.2
 3 AR             89       100  
 4 CT             82        83.6
 5 DE             68        61.4
 6 DC             41        53.5
 7 FL             33        38.4
 8 GA             55        78.3
 9 HI             62        71.6
10 ID             38        45.8
# ℹ 36 more rows

Finally, I calculated the percentage-point difference between the two years and classified each state as an increase, decrease, or no change.

change_data <- change_data |>
  mutate(
    change =
      `2023–2024` - `2019–2020`,
    direction = case_when(
      change > 0 ~ "Increase",
      change < 0 ~ "Decrease",
      TRUE ~ "No change"
    )
  )

change_data
# A tibble: 46 × 5
   state `2019–2020` `2023–2024` change direction
   <chr>       <dbl>       <dbl>  <dbl> <chr>    
 1 AL             57        94.2  37.2  Increase 
 2 AZ             38        43.2   5.23 Increase 
 3 AR             89       100    11    Increase 
 4 CT             82        83.6   1.57 Increase 
 5 DE             68        61.4  -6.60 Decrease 
 6 DC             41        53.5  12.5  Increase 
 7 FL             33        38.4   5.43 Increase 
 8 GA             55        78.3  23.3  Increase 
 9 HI             62        71.6   9.64 Increase 
10 ID             38        45.8   7.80 Increase 
# ℹ 36 more rows

The change variable represents the percentage-point difference between 2019–2020 and 2023–2024 for each state. Using the same start and end years ensures that differences between states are not due to comparing different time periods. The data wrangling approach used here, including reshaping the data and creating new variables, follows techniques introduced in Data Science in Education Using R (Estrellado et al., 2020).

3. ANALYZE

The main analytical approach in this case study is descriptive statistics, using longitudinal comparisons. This approach is appropriate because the research questions focus on describing observed patterns in access, comparing states, and examining change over time rather than testing causal relationships.

The main metrics include access percentages; counts of states increasing or decreasing; median access; interquartile range; overall range; percentage-point change; and the difference between North Carolina’s and the national percentage.

3a. Explore the Distribution of State Access

Before addressing the research questions, I examined the distribution of state-level access during 2023–2024. I selected this year because it contains 50 state and DC observations, providing nearly complete coverage.

access_2023 <- cs_long |>
  filter(
    school_year == "2023–2024",
    state != "National",
    !is.na(access)
  )

access_2023
# A tibble: 50 × 3
   state school_year access
   <chr> <fct>        <dbl>
 1 AL    2023–2024     94.2
 2 AZ    2023–2024     43.2
 3 AR    2023–2024    100  
 4 CA    2023–2024     51.7
 5 CO    2023–2024     66.3
 6 CT    2023–2024     83.6
 7 DE    2023–2024     61.4
 8 DC    2023–2024     53.5
 9 FL    2023–2024     38.4
10 GA    2023–2024     78.3
# ℹ 40 more rows

I began by examining a basic statistical summary of access.

summary(access_2023$access)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  31.40   53.53   64.00   66.57   81.07  100.00 

I also calculated the median and interquartile range (IQR), two descriptive measures used earlier in the course.

access_2023 |>
  summarize(
    median_access = median(access),
    IQR_access = IQR(access)
  )
# A tibble: 1 × 2
  median_access IQR_access
          <dbl>      <dbl>
1          64.0       27.5

The median state/DC access percentage in 2023–2024 is approximately 64%.

The middle 50% of state/DC observations spans roughly 53.5% to 81.1%, producing an interquartile range of about 27.5 percentage points.

Access also ranges from approximately 31.4% to 100%.

This wide range shows substantial variation in access across states during the same school year.

The histogram below provides a visual view of this distribution.

ggplot(
  access_2023,
  aes(x = access)
) +
  geom_histogram(
    bins = 10
  ) +
  labs(
    title = "Distribution of Computer Science Access Across States",
    subtitle = "2023–2024 school year",
    x = "Percent of High Schools Offering Foundational CS",
    y = "Number of States/DC"
  ) +
  theme_minimal()

It is important not to treat the simple average of state percentages as the national access percentage.

Each state has a different number of high schools. An unweighted state average would give a small state the same influence as a much larger state.

For national comparisons, I therefore used the National value supplied directly by Code.org rather than calculating an unweighted national estimate from the state percentages.

3b. Research Question 1

How has access to foundational computer science changed over time in the United States?

To answer the first research question, I filtered the dataset to the national observations.

national_trend <- cs_long |>
  filter(state == "National")

national_trend
# A tibble: 7 × 3
  state    school_year access
  <chr>    <fct>        <dbl>
1 National 2018–2019     45  
2 National 2019–2020     47  
3 National 2020–2021     51  
4 National 2021–2022     53  
5 National 2022–2023     57.7
6 National 2023–2024     60  
7 National 2024–2025     60  

The national values in the workbook are approximately 45% in 2018–2019, 47% in 2019–2020, 51% in 2020–2021, 53% in 2021–2022, 57.7% in 2022–2023, 60% in 2023–2024, and 60% in 2024–2025.

A line chart makes the overall pattern easier to see.

ggplot(
  national_trend,
  aes(
    x = school_year,
    y = access,
    group = 1
  )
) +
  geom_line(
    linewidth = 1
  ) +
  geom_point(
    size = 3
  ) +
  labs(
    title = "National Access to Foundational Computer Science",
    subtitle = "2018–2019 through 2024–2025",
    x = "School Year",
    y = "Percent of High Schools Offering Foundational CS",
    caption = "Source: Code.org, High School 2025 Data (Public)"
  ) +
  theme_minimal() +
  theme(
    axis.text.x = element_text(
      angle = 45,
      hjust = 1
    )
  )

National access increased from 45% in 2018–2019 to 60% in 2024–2025, a 15-percentage-point increase over the period covered in the workbook.

The increase was not identical every year. Growth occurred across several consecutive years, while the reported national percentage remained at 60% between 2023–2024 and 2024–2025.

Overall, access to foundational computer science increased nationally over the seven years.

However, the 2024–2025 national value of 60% also shows that access was still not universal.

3c. Research Question 2

Which states experienced the largest increases or decreases in access between 2019–2020 and 2023–2024?

I first examined whether increases or decreases were more common among states with data at both endpoints.

table(change_data$direction)

 Decrease  Increase No change 
        7        38         1 

Among the 46 state and DC observations with data in both years, 38 increased, 7 decreased, and 1 showed no change.

Most states included in the comparison therefore experienced an increase in access.

change_data |>
  arrange(desc(change))
# A tibble: 46 × 5
   state `2019–2020` `2023–2024` change direction
   <chr>       <dbl>       <dbl>  <dbl> <chr>    
 1 AL             57        94.2   37.2 Increase 
 2 MS             48        84.9   36.9 Increase 
 3 OK             37        71.5   34.5 Increase 
 4 WY             41        74.5   33.5 Increase 
 5 KY             45        75.9   30.9 Increase 
 6 NH             67        94.8   27.8 Increase 
 7 GA             55        78.3   23.3 Increase 
 8 NM             32        53.6   21.6 Increase 
 9 NV             77        97.9   20.9 Increase 
10 IA             66        84.4   18.4 Increase 
# ℹ 36 more rows

The largest increases between 2019–2020 and 2023–2024 include Alabama, Mississippi, Oklahoma, Wyoming, and Kentucky.

Alabama increased from 57% to approximately 94.2%, a gain of approximately 37.2 percentage points.

Mississippi increased from 48% to approximately 84.9%, a gain of approximately 36.9 percentage points.

Oklahoma increased from 37% to approximately 71.5%, a gain of approximately 34.5 percentage points.

Wyoming increased from 41% to approximately 74.5%, a gain of approximately 33.5 percentage points.

Kentucky increased from 45% to approximately 75.9%, a gain of approximately 30.9 percentage points.

Rhode Island declined by approximately 6.6 percentage points, Delaware declined by approximately 6.6 percentage points, Virginia declined by approximately 4.6 percentage points, and Montana declined by approximately 4.6 percentage points.

The following bar chart compares the percentage-point change for all states included in the analysis.

ggplot(
  change_data,
  aes(
    x = reorder(state, change),
    y = change,
    fill = direction
  )
) +
  geom_bar(stat = "identity") +
  coord_flip() +
  labs(
    title = "Change in Computer Science Access by State",
    subtitle = "2019–2020 to 2023–2024",
    x = "State",
    y = "Percentage-Point Change",
    fill = "Direction",
    caption = "Only states/DC with data in both years are included."
  ) +
  theme_minimal() +
  theme(
    axis.text.y = element_text(size = 8)
  )

The graph shows that changes in access to computer science varied considerably across states. Most states saw increases, but the size of those increases varied, and several states saw decreases or no change. Overall, increased access was the dominant pattern, but the national trend was not shared equally across every state.

3d. Research Question 3

How does North Carolina’s access to foundational computer science compare with the national trend?

To make this comparison, I filtered the data to include only North Carolina and the national observations.

nc_national <- cs_long |>
  filter(
    state %in% c(
      "NC",
      "National"
    )
  )

nc_national
# A tibble: 14 × 3
   state    school_year access
   <chr>    <fct>        <dbl>
 1 National 2018–2019     45  
 2 National 2019–2020     47  
 3 National 2020–2021     51  
 4 National 2021–2022     53  
 5 National 2022–2023     57.7
 6 National 2023–2024     60  
 7 National 2024–2025     60  
 8 NC       2018–2019     NA  
 9 NC       2019–2020     51  
10 NC       2020–2021     59  
11 NC       2021–2022     61  
12 NC       2022–2023     71  
13 NC       2023–2024     69.0
14 NC       2024–2025     69.8

The line chart below compares the North Carolina and national trends over time.

ggplot(
  nc_national,
  aes(
    x = school_year,
    y = access,
    color = state,
    group = state
  )
) +
  geom_line(
    linewidth = 1
  ) +
  geom_point(
    size = 3
  ) +
  labs(
    title = "North Carolina and National Computer Science Access",
    subtitle = "Percentage of high schools offering foundational computer science",
    x = "School Year",
    y = "Percent Access",
    color = "Location",
    caption = "Source: Code.org, High School 2025 Data (Public)"
  ) +
  theme_minimal() +
  theme(
    axis.text.x = element_text(
      angle = 45,
      hjust = 1
    )
  )
Warning: Removed 1 row containing missing values or values outside the scale range
(`geom_line()`).
Warning: Removed 1 row containing missing values or values outside the scale range
(`geom_point()`).

North Carolina does not have a reported value for 2018–2019, so the comparison begins in 2019–2020.

North Carolina increased from 51% in 2019–2020 to approximately 69.8% in 2024–2025. This represents an increase of approximately 18.8 percentage points.

Over the same period, national access increased from 47% to 60%, an increase of 13 percentage points.

In 2024–2025, North Carolina was approximately 9.8 percentage points above the national percentage.

Overall, access increased in both North Carolina and the national data, but the increase was larger in North Carolina during the comparable period.

4. COMMUNICATE

4a. Key Findings

Three findings stand out from the analysis.

First, access to foundational computer science increased nationally. The national percentage of high schools offering foundational computer science increased from 45% in 2018–2019 to 60% in 2024–2025.

Second, most states with comparable data also experienced increases. Of the 46 state or D.C. observations included in the 2019–2020 to 2023–2024 comparison, 38 increased, 7 decreased, and 1 showed no change. This shows that the overall national increase was not evenly distributed across all states.

Finally, North Carolina experienced substantial growth. Access increased from 51% in 2019–2020 to approximately 69.8% in 2024–2025. In the most recent year, North Carolina was approximately 9.8 percentage points above the national percentage.

Overall, access expanded during the period studied, but the magnitude and direction of change varied by state.

4b. Potential Actions

These findings could help educators, school administrators, policymakers, and state education leaders identify states that may deserve additional attention. States with lower or decreasing access could be examined more closely to determine what factors may be limiting the expansion of computer science opportunities.

States with large increases could also be studied to determine whether particular policies or initiatives contributed to their growth. For North Carolina, a useful next step would be to move beyond course availability and examine student participation. Increased access does not necessarily mean that all students are enrolling in computer science courses at similar rates.

Future work could examine whether increased access translates into student participation across factors such as gender, race and ethnicity, socioeconomic status, disability status, or school location.

Using educational data to identify patterns and guide further investigation is consistent with the learning analytics approach described by Krumm et al. (2018).

4c. Limitations and Ethical/Legal Considerations

Several limitations affect how these results should be interpreted. The most important limitation is that access does not measure quality. The dataset indicates whether high schools offer qualifying foundational computer science courses, but it does not measure teacher effectiveness, curriculum quality, student learning, or course completion.

Access is also different from participation. A school may offer a computer science course even if relatively few students actually enroll. Another limitation is missing data. Not every state has an observation for every school year. Missing values were therefore kept as NA rather than being treated as zero.

I used 2023–2024 instead of 2024–2025 for the main state-level comparison because the dataset contains much more complete state coverage in 2023–2024. The dataset may also not capture every computer science opportunity available outside a student’s high school, such as dual-enrollment courses, community colleges, universities, or after-school programs.

Finally, this analysis is descriptive. It identifies patterns in access but cannot determine why particular states increased or decreased. Ethical and legal concerns are relatively limited because the dataset contains aggregated state level data rather than personally identifiable student information. However, the state percentages should not be interpreted as rankings of overall computer science education quality. The measure reflects course availability and does not capture instructional quality, student participation, or learning outcomes.

4d. Conclusion

This case study examined changes in access to foundational computer science education across U.S. high schools. Overall, national access increased, and most states with comparable data also experienced growth. However, the size of those increases varied, and several states experienced decreases.

North Carolina also experienced considerable growth and was above the national percentage in the most recent year. The analysis shows that computer science opportunities have expanded, but access remains uneven. Future research could build on these findings by examining student participation, demographic differences, school location, and other factors related to equitable access to computer science opportunities.

4e. References

Code.org. (2025). 2025 State of AI + CS Education. Code.org Advocacy Coalition. https://advocacy.code.org/stateofcs

Estrellado, R. A., Freer, E. A., Mostipak, J., Rosenberg, J. M., & Velásquez, I. C. (2020). Data science in education using R. Routledge. https://datascienceineducation-1ed.netlify.app/

Krumm, A., Means, B., & Bienkowski, M. (2018). Learning analytics goes to school: A collaborative approach to improving education. Routledge.