From 4ad2344b1de62e34d5970c953522064d6a2f9234 Mon Sep 17 00:00:00 2001 From: Alex Gebben Work Date: Wed, 12 Aug 2026 11:28:18 -0600 Subject: [PATCH] Added Multiplier histograms --- Tapestry.r | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Tapestry.r b/Tapestry.r index 5324523..4b24bbb 100644 --- a/Tapestry.r +++ b/Tapestry.r @@ -38,8 +38,25 @@ ALL_ORIG <- ALL ALL <- ALL %>% filter(Total<5) REST <- ALL %>% filter(State!='WY') WY <- ALL %>% filter(State=='WY') -ggplot(ALL,aes(x=State,y=Total)) + geom_jitter(width = 0.5,size=0.1,aes(color=State)) + geom_boxplot(fill=NA,outlier.shape=NA)+theme(legend.position = "none",aes(color=State) ) -+theme_bw() +PLOT <- ggplot(ALL,aes(x=State,y=Total)) + geom_jitter(width = 0.5,size=0.1,aes(color=State)) + geom_boxplot(fill=NA,outlier.shape=NA)+theme_bw()+theme(legend.position = "none",aes(color=State) ) +ylab("Type II Regional Multipliers") +ggsave("Multipliers.png", plot = PLOT, width = 10, height = 7.5) +library(janitor) +IMPLAN <- read_csv("States/Wyoming_2024_SAM_v1.5.6/IMPLAN_multipliers.csv") %>% clean_names() %>% select(-x1) +hist(IMPLAN %>% pull(type_sam_multiplier)+1,breaks=40) +IMPLAN <- IMPLAN %>% pull(type_sam_multiplier)+1 +DIST <- rbind(cbind("IMPLAN",IMPLAN),cbind("Tapestry",WY %>% pull(Total))) %>% as_tibble %>% rename(Source=V1,"Multiplier"=IMPLAN) %>% mutate(Multiplier=as.numeric(Multiplier)) +Histogram <- ggplot(DIST, aes(x = Multiplier,group=Source,fill=Source)) + geom_histogram(position = 'identity',alpha=0.5,bins=60)+theme_bw()+xlab("Type II Multiplier")+scale_x_continuous(breaks=0.25*1:100)+theme(legend.position = "top") +ggsave("Histogram.png", plot = Histogram, width = 10, height = 7.5) + + + +Density_Plot <- ggplot(DIST, aes(x = Multiplier,y=after_stat(density),group=Source,fill=Source)) + geom_density( linewidth = 1,alpha=0.75)+theme_bw()+xlab("Type II Multiplier")+scale_x_continuous(breaks=0.25*1:100)+theme(legend.position = "top") +ggsave("Density.png", plot = Density_Plot, width = 10, height = 7.5) + +Density_Plot + + +ggplot(DIST, aes(x = Multiplier)) + geom_histogram(stat_bin(),fill = "#3a86d4", alpha = 0.7) ##############Import analsysi GET_IMPORT <- function(ROOT_FOLDER="States/",YEAR=2024){ #ROOT_FOLDER="States/";YEAR=2024