This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
passage line line_text probe correct_response Dimension Foreshadow Shift | |
6 1 Juan’s meeting with the boss didn’t quite go as planned. n space Temporal y y | |
6 2 He sat at his desk snacking on mixed nuts. n space Temporal y y | |
6 3 He was going to have to finish the new designs before the next client meeting. n space Temporal y y | |
6 4 It was going to take all night. n space Temporal y y | |
6 5 The next morning, he reached for his coffee before remembering the cup was empty. n space Temporal y y | |
6 6 At least the designs were finished. n space Temporal y y | |
6 7 He could probably get a couple of hours of sleep before the meeting. n space Temporal y y | |
6 0 SNACKING y y Temporal y y | |
6 0 Juan’s meeting went as expected. y n Temporal y y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##install.packages("googlesheets") | |
# Load googlesheets package | |
library(tidyverse) | |
library(googlesheets) | |
library(randomizeR) | |
# Connect R and my google drive | |
gs_auth(new_user = TRUE) | |
# Export the sheet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Load Raaijmakers 1999 data set from languageR | |
library(languageR) | |
data(quasif) | |
summary(quasif) | |
## Compute the variance of random effect | |
library(lme4) | |
## Parameters for the general effect size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!require(simr)){install.packages("simr"); library(simr)}else{library(simr)} | |
#library(lme4) | |
## Means and Variance of Behavior data | |
CWL2016RT <- rbind(M=c(.793,.815,.893,.866),VAR=c(.011^2,.010^2,.016^2,.015^2)) | |
## Got the parameters of RT distributions | |
## Referring to https://stats.stackexchange.com/questions/12232/calculating-the-parameters-of-a-beta-distribution-using-the-mean-and-variance | |
estBetaParams <-function(mu, var) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Model from appendix 3 | |
``` | |
model{ | |
# There are 20 individuals. | |
for (i in 1:n) { | |
# The dependent variable has a mean (beta) and prior precision (tau). | |
y[i] ~ dnorm(beta[i], tau) | |
# Beta consists of an intercept: mu (which is, without any predictors in the model equal to the mean of our dependent variable) | |
beta[i] <- mu [i]} | |
# Mu (=mean of dependent variable) has a normal prior distribution with a mean of 80 and a prior precision of .01 and the prior is limited to obtain scores between 40 and 180. The prior precision of the dependent variable, tau, has a inverse gamma prior distribution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 在Rstudio,Tools -> Global Options -> General -> Default Text Encoding -> UTF-8 | |
## 系統語系要設定為台灣正體中文 | |
Sys.setlocale(category = "LC_ALL", locale = "cht") | |
##讀取檔案、提取資料與製造變項 | |
#這是一般 TXT 檔,檔頭有變項名稱 | |
#資料來自於 NHIS 2010 調查,取 1955 年以前出生者(55歲以上) |