This notebook describes the predicted results for a Boundary Extension project with objects and scenes

library(tidyverse)
library(msm)
library(Hmisc)

Next, prepare the data

sim_objects <- function(nS=2, nI=100, nLevels=2, std=1){

  dp <- seq(from=0, to=5, length.out = nLevels)

  d <- tibble::tibble(subject = rep(1:nS, each=nI)) %>%
    dplyr::mutate(item = rep(1:nI, times=nS)) %>%
    dplyr::mutate(condition = rep(c('Less','More'), each=nI/nLevels, times=nS)) %>% # refers to how items were studied
    dplyr::mutate(condition = factor(condition, levels=c('Less','More'))) %>% # as compared to studied with same occlusion
    dplyr::mutate(subject = factor(subject)) %>%
    dplyr::mutate(item = factor(item)) %>%
    dplyr::mutate(dp = dp[condition]) %>%
    dplyr::mutate(dp = dp + rnorm(n(), 0, std))

  return(d)
}


sim_scenes <- function(nS=2, nI=40, nLevels=2, std=1){

  dp <- seq(from=0, to=5, length.out = nLevels)

  d <- tibble::tibble(subject = rep(1:nS, each=nI)) %>%
    dplyr::mutate(item = rep(1:nI, times=nS)) %>%
    dplyr::mutate(condition = rep(c('Close','Wide'), each=nI/nLevels, times=nS)) %>% # refers to how items were studied
    dplyr::mutate(condition = factor(condition, levels = c('Wide','Close'))) %>%
    dplyr::mutate(subject = factor(subject)) %>%
    dplyr::mutate(item = factor(item)) %>%
    dplyr::mutate(dp = dp[condition]) %>%
    dplyr::mutate(dp = dp + rnorm(n(), 0, std))

  return(d)
}
sim_scenes(std=1) %>%
  ggplot(mapping = aes(x=condition, y=dp)) +
  geom_point() +
  xlab("Studied framing") +
  ylab('d`') +
  ggtitle('Scenes') +
  theme(
    text = element_text(size=25)
    , axis.text.y = element_blank()
    , axis.ticks = element_blank()
    , panel.background = element_blank()
    , plot.background = element_blank()
    , axis.line = element_line()
    , plot.margin=unit(c(0,0,.25,0),"cm")
  ) +
  ggsave('Scenes.eps')
sim_objects(std=1) %>%
  ggplot(mapping = aes(x=condition, y=dp)) +
  geom_point() +
  xlab("Proportion Occluded") +
  ylab('d`') +
  ggtitle('Objects') +
  theme(
    text = element_text(size=25)
    , axis.text.y = element_blank()
    , axis.ticks = element_blank()
    , panel.background = element_blank()
    , plot.background = element_blank()
    , axis.line = element_line()
    , plot.margin=unit(c(0,0,.25,0),"cm")
  ) +
  ggsave('Objects.eps')


psadil/ber documentation built on May 26, 2019, 10:32 a.m.