data(attitude)
o = lm(rating ~ complaints, data = attitude)
par(mfrow=c(1,2), bg="white")
plot(rating ~ complaints, data = attitude)
abline(o, col = "red")
plot(o, ask = FALSE)
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
--- | |
runtime: shiny | |
--- | |
```{r echo=FALSE, message=FALSE, warning=FALSE} | |
require(shinyjs) | |
useShinyjs(rmd=TRUE) | |
observe({ | |
updateTextInput(session, 'ID', value = "Updated.") |
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
## Richard D. Morey | |
## 3 Nov 2017 | |
# Redirect plots to temp directory | |
# We just want the variables | |
wd = getwd() | |
setwd(tempdir()) | |
source('https://osf.io/x73zq/download?version=1') | |
setwd(wd) |
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
## Given a (scaled Cauchy) Bayes factor for the null against the | |
## alternative (Rouder et al 2009), yields the t statistic | |
## that would yield it. The ... arguments are passed to | |
## the ttest.tstat function. | |
bf.inv = Vectorize(function(b10, ...){ | |
fn = Vectorize(function(t,...){ | |
BayesFactor::ttest.tstat(t,...)[["bf"]] | |
}, "t") | |
t0 = optimize(function(t0, ...){ |
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
find.ncp = Vectorize(function(a=.05, b=.2, df=1){ | |
cr = qchisq(1-a,df) | |
q = optimize(function(q){ | |
(pchisq(cr,df,ncp=q/(1 - q)) - b)^2 | |
},interval = c(0,1))$minimum | |
q / (1 - q) | |
},"b") | |
find.eb = Vectorize(function(a = 0.05, b = .2, df = 1){ |
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
## Explore the sampling distribution of eta^2, omega^2-hat, and epsilon^2 | |
## Richard D. Morey | |
## Sept 30, 2017 | |
## Settings | |
## Number of participants in group | |
N = 10 | |
## Number of groups | |
J = 3 |
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
ID | fuseTime | condition | logFuseTime | |
---|---|---|---|---|
1 | 47.20001 | NV | 3.85439410445589 | |
2 | 21.99998 | NV | 3.09104154426699 | |
3 | 20.39999 | NV | 3.01553441065397 | |
4 | 19.70001 | NV | 2.98061914335803 | |
5 | 17.4 | NV | 2.85647020622048 | |
6 | 14.7 | NV | 2.68784749378469 | |
7 | 13.39999 | NV | 2.59525396068793 | |
8 | 13 | NV | 2.56494935746154 | |
9 | 12.3 | NV | 2.50959926237837 |
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
--- | |
title: "Normal meta-analysis" | |
author: "Richard D. Morey" | |
date: "04/07/2017" | |
output: html_document | |
--- | |
```{r} | |
# data here |
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
x = scan() | |
0.78 | |
0.71 | |
0.69 | |
0.71 | |
0.73 | |
0.68 | |
0.69 | |
0.64 | |
0.64 |