Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Replication of null results - Absence of evidence or evidence of absence
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Samuel Pawel
Replication of null results - Absence of evidence or evidence of absence
Commits
54b4893f
Commit
54b4893f
authored
1 year ago
by
SamCH93
Browse files
Options
Downloads
Patches
Plain Diff
sensitivity analysis
parent
a02532d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
paper/rsabsence.Rnw
+104
-0
104 additions, 0 deletions
paper/rsabsence.Rnw
rsabsence.pdf
+0
-0
0 additions, 0 deletions
rsabsence.pdf
with
104 additions
and
0 deletions
paper/rsabsence.Rnw
+
104
−
0
View file @
54b4893f
...
...
@@ -52,6 +52,7 @@ Reproducibility <- TRUE
## packages
library
(
ggplot
2
)
# plotting
library
(
gridExtra
)
# combining ggplots
library
(
dplyr
)
# data manipulation
library
(
reporttools
)
# reporting of p
-
values
...
...
@@ -700,6 +701,109 @@ which is available in our git repository.% The effect estimates and standard
\bibliography
{
bibliography
}
\appendix
\begin
{
appendixbox
}
% \label{first:sensitivity}
% \section{Sensitivity analyses}
\begin
{
center
}
<< "sensitivity", fig.height
=
8
>>
=
## compute number of successful replications as a function of the equivalence margin
marginseq <
-
seq
(
0
.
01
,
4
.
5
,
0
.
01
)
alphaseq <
-
c
(
0
.
005
,
0
.
05
,
0
.
1
)
sensitivityGrid <
-
expand.grid
(
m
=
marginseq, a
=
alphaseq
)
equivalenceDF <
-
lapply
(
X
=
seq
(
1
, nrow
(
sensitivityGrid
))
, FUN
=
function
(
i
)
{
m <
-
sensitivityGrid
$
m[i]
a <- sensitivityGrid
$
a
[
i
]
rpcbNull
$
ptosto <- with(rpcbNull, pmax(pnorm(q = smdo, mean = m, sd = so,
lower.tail = TRUE),
pnorm(q = smdo, mean = -m, sd = so,
lower.tail = FALSE)))
rpcbNull
$
ptostr <
-
with
(
rpcbNull, pmax
(
pnorm
(
q
=
smdr, mean
=
m, sd
=
sr,
lower.tail
=
TRUE
)
,
pnorm
(
q
=
smdr, mean
=
-
m, sd
=
sr,
lower.tail
=
FALSE
)))
successes <
-
sum
(
rpcbNull
$
ptosto <= a
&
rpcbNull
$
ptostr <
=
a
)
data.frame
(
margin
=
m, alpha
=
a,
successes
=
successes, proportion
=
successes
/
nrow
(
rpcbNull
))
}
)
%>%
bind
_
rows
()
## plot number of successes as a function of margin
nmax <
-
nrow
(
rpcbNull
)
bks <
-
seq
(
0
, nmax, round
(
nmax
/
5
))
labs <
-
paste
0
(
bks, "
(
", bks
/
nmax
*
100
, "
%)")
plotA <
-
ggplot
(
data
=
equivalenceDF,
aes
(
x
=
margin, y
=
successes,
color
=
factor
(
alpha, ordered
=
TRUE
)))
+
facet
_
wrap
(
~ "Equivalence test"
)
+
geom
_
vline
(
xintercept
=
margin, lty
=
2
, alpha
=
0
.
4
)
+
geom
_
step
(
alpha
=
0
.
9
, linewidth
=
0
.
8
)
+
scale
_
y
_
continuous
(
breaks
=
bks, labels
=
labs
)
+
## scale
_
y
_
continuous
(
labels
=
scales::percent
)
+
guides
(
color
=
guide
_
legend
(
reverse
=
TRUE
))
+
labs
(
x
=
bquote
(
"Equivalence margin" ~ Delta
)
,
y
=
"Successful replications",
color
=
bquote
(
italic
(
"p"
)[
"TOST"
]
~ "threshold" ~ alpha
))
+
theme
_
bw
()
+
theme
(
panel.grid.minor
=
element
_
blank
()
,
panel.grid.major
=
element
_
blank
()
,
strip.background
=
element
_
rect
(
fill
=
alpha
(
"tan",
0
.
4
))
,
strip.text
=
element
_
text
(
size
=
12
)
,
legend.position
=
c
(
0
.
85
,
0
.
25
)
,
plot.background
=
element
_
rect
(
fill
=
"transparent", color
=
NA
)
,
## axis.text.y
=
element
_
text
(
hjust
=
0
)
,
legend.box.background
=
element
_
rect
(
fill
=
"transparent", colour
=
NA
))
## compute number of successful replications as a function of the prior scale
priorsdseq <
-
seq
(
0
,
40
,
0
.
1
)
bfThreshseq <
-
c
(
3
,
6
,
10
)
sensitivityGrid
2
<
-
expand.grid
(
s
=
priorsdseq, thresh
=
bfThreshseq
)
bfDF <
-
lapply
(
X
=
seq
(
1
, nrow
(
sensitivityGrid
2
))
, FUN
=
function
(
i
)
{
priorsd <
-
sensitivityGrid
2
$
s[i]
thresh <- sensitivityGrid2
$
thresh
[
i
]
rpcbNull
$
BForig <- with(rpcbNull, BF01(estimate = smdo, se = so, unitvar = priorsd
^
2))
rpcbNull
$
BFrep <
-
with
(
rpcbNull, BF
01
(
estimate
=
smdr, se
=
sr, unitvar
=
priorsd
^
2
))
successes <
-
sum
(
rpcbNull
$
BForig >= thresh
&
rpcbNull
$
BFrep >
=
thresh
)
data.frame
(
priorsd
=
priorsd, thresh
=
thresh,
successes
=
successes, proportion
=
successes
/
nrow
(
rpcbNull
))
}
)
%>%
bind
_
rows
()
## plot number of successes as a function of prior sd
plotB <
-
ggplot
(
data
=
bfDF,
aes
(
x
=
priorsd, y
=
successes, color
=
factor
(
thresh, ordered
=
TRUE
)))
+
facet
_
wrap
(
~ "Bayes factor"
)
+
geom
_
vline
(
xintercept
=
4
, lty
=
2
, alpha
=
0
.
4
)
+
geom
_
step
(
alpha
=
0
.
9
, linewidth
=
0
.
8
)
+
scale
_
y
_
continuous
(
breaks
=
bks, labels
=
labs, limits
=
c
(
0
, nmax
))
+
## scale
_
y
_
continuous
(
labels
=
scales::percent, limits
=
c
(
0
,
1
))
+
guides
(
color
=
guide
_
legend
(
reverse
=
TRUE
))
+
labs
(
x
=
"Prior distribution scale",
y
=
"Successful replications ",
color
=
bquote
(
"BF"
[
"
01
"
]
~ "threshold" ~ gamma
))
+
theme
_
bw
()
+
theme
(
panel.grid.minor
=
element
_
blank
()
,
panel.grid.major
=
element
_
blank
()
,
strip.background
=
element
_
rect
(
fill
=
alpha
(
"tan",
0
.
4
))
,
strip.text
=
element
_
text
(
size
=
12
)
,
legend.position
=
c
(
0
.
85
,
0
.
25
)
,
plot.background
=
element
_
rect
(
fill
=
"transparent", color
=
NA
)
,
## axis.text.y
=
element
_
text
(
hjust
=
0
)
,
legend.box.background
=
element
_
rect
(
fill
=
"transparent", colour
=
NA
))
grid.arrange
(
plotA, plotB, ncol
=
1
)
@
\captionof
{
figure
}{
Number of successful replications of original null results in
the RPCB as a function of the margin
$
\Delta
$
of equivalence test
(
$
p
_{
\text
{
TOST
}}
\leq
\alpha
$
in both studies
)
or the scale of the prior
distribution for the effect under the alternative
$
H
_{
1
}$
of the Bayes
factor
(
$
\BF
_{
01
}
\geq
\gamma
$
in both studies
)
.
}
\end
{
center
}
\end
{
appendixbox
}
<< "sessionInfo
1
", eval
=
Reproducibility, results
=
"asis" >>
=
## print R sessionInfo to see system information and package versions
...
...
This diff is collapsed.
Click to expand it.
rsabsence.pdf
+
0
−
0
View file @
54b4893f
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment