Population_Study/TerraPower_Values.r
2025-12-04 17:27:09 -07:00

34 lines
1.6 KiB
R

library(tidyverse)
PERM <- read_csv("./Data/Raw_Data/TerraPower_Report_Data/Monthly_In_Migration_Operations_Workforce.csv")
NUM_YEARS <- ceiling(nrow(PERM)/12)
c(8:12,rep(1:12,ceiling(nrow(PERM)/12)))[1:nrow(PERM)]
DATES <- as.Date(paste0(2025,"-",8:12,"-",18))
for(YEAR in 2026:(2026+NUM_YEARS)){
DATES <- c(DATES,as.Date(paste0(YEAR,"-",1:12,"-",18)))
}
PERM$Date <- DATES[1:nrow(PERM)]
PERM$Year <- year(PERM$Date)
PERM$Add_Emp <- c(0,diff(PERM$In_Migration))
PERM <- PERM %>% group_by(Year) %>% summarize(Perm_Emp_Migration=sum(Add_Emp),Total_Wages=sum(Average_Wages_Present_USD*In_Migration),Current_Perm_Workers=round(mean(In_Migration) ))
PERM[7,3]<-PERM[7,3]*3 #4 months (1/3) year only seen in sample
PERM[,"Total_Migration"] <- round(PERM[,2]+PERM[,2]*0.8*2.3) #TerraPower assumes 80% have families and the average family is 2.3 people
TEMP <- read_csv("./Data/Raw_Data/TerraPower_Report_Data/Monthly_In_Migration_Construction_Workforce.csv")
TEMP[,1] <- TEMP[,1]*0.41 #TerraPower assumes 41% migrate into Lincoln
TEMP[,1] <- TEMP[,1]*0.80 #I assume 80% of lincoln will be in Kemmerer
TEMP$Date <- DATES[1:nrow(TEMP)]
TEMP$Year <- year(TEMP$Date)
TEMP$Add_Emp <- c(0,diff(TEMP$In_Migration))
TEMP <- TEMP %>% group_by(Year) %>% summarize(Temp_Emp_Migration=sum(Add_Emp),Total_Wages=sum(Average_Wages_Present_USD*In_Migration),Current_Temp_Workers=round(mean(In_Migration) ))
TEMP[,"Total_Migration"] <- round(TEMP[,2]+TEMP[,2]*0.37*2.3) #TerraPower assumes 37% have families and the average family is 2.3 people
TEMP[,2] <- round(TEMP[,2])
TEMP[4:7,2] <- TEMP[4:7,2]-1
TEMP[7,2] <- TEMP[7,2]-1
TEMP[4:7,5] <- TEMP[4:7,5] -2
TEMP[7,5] <- TEMP[7,5] -1