R/test_proximity.R

source('R/plot.R')

proximity <- read_csv("C:/Users/delliotthart/Desktop/proximity.csv")

prox <- proximity %>% as_tibble() %>%
  subset(!is.na(mgr_id)) %>%
  subset(!is.na(pc)) %>%
  subset(!is.na(physical_overlap_w_mgr)) %>%
  select(pc, ln_norm_sal,physical_overlap_w_mgr,male,mgr_male)

prox_male <- prox %>% subset(mgr_male == 1)

prox_fem <-  prox %>% subset(mgr_male == 0)

to_plot_m <- condistr_plot(prox_male,x="physical_overlap_w_mgr",
                         y="pc", by="male")

ggplot(data = to_plot,aes(x=x,y=y)) +
  geom_point(aes(color=factor(by), alpha = weights,group=100*by+ptile))+
  geom_path(data = to_plot[ptile==50,], aes(color=factor(by),group=by)) +
  geom_path(data = to_plot[ptile==25 | ptile==75 ,], aes(color=factor(by),group=100*by+ptile[ptile==25 | ptile==75]))
delliotthart/condistR documentation built on May 14, 2021, 6:01 p.m.