All Manylabs 2 materials (data, output, scipts, etc.) are in the ManyLabs2 repository https://github.com/ManyLabsOpenScience/ManyLabs2 or on the OSF page: https://osf.io/ux3eh/
The manylabRs package currently does not function as welll as we would like, so currently we advise to use the sourceable file in the ManyLabs 2 repository, you might also need package invctr
.
library(devtools)
devtools::source_url("https://raw.githubusercontent.com/ManyLabsOpenScience/manylabRs/master/R/manylabRs_SOURCE.R")
# NOTE: Don't run init() if you do not want unsupervised loading, and possibly installing of packages we need to run ML2 scripts!!
# init()
devtools::source_url("https://raw.githubusercontent.com/FredHasselman/invctr/master/R/invictor.R")
Several ways to install the package.
Use the code below to install the manylabRs
package directly from GitHub.
library(devtools)
install_github("ManyLabsOpenScience/manylabRs")
First download the tarball, then install the package locally through the RStudio package installer: Tools
>> Install Packages...
The main function to inspect is get.analyses()
.
It will take one or more take analysis (studies
) from the masteRkey
sheet and an indication of whether the analysis is:
global
- will disregard the clusters in the data and use all valid caes for analyses, bothprimary
andsecondary
analyses have aglobal
variant.primary
- target analysis of replication study conducted for each lab seperately.secondary
- additional analyses conducted for each lab seperately.order
- presentation order analyses disregard the clusters int he data, each order is analysed seperately
Have a look at
saveConsole.R
which calls thetestScript()
function and creates a log file with lots of info about the analysis steps.
The example below runs a global analysis for Huang.1
library(manylabRs)
library(tidyverse)
df <- get.analyses(studies = 1, analysis.type = 1)
The object df
contains two named lists:^[these names correspond to the analysis name in the masteRkey spreadsheet]
This list contains dataframes with the relevant variables for each analysis, but before the analysis specific variable functions (varfun
) are applied. There is a Boolean variable case.include
which indicates whther a case is valid and should be included for analysis.
df$raw.case$Huang.1
The dataframe in aggregated
contains the data as is was analysed, after the varfun
is applied.
df$aggregated$Huang.1
- Get information from
masteRkey
on the analyses to run:get.info()
- Get a data filter based on exclusion criteria:
get.chain()
- Select the appropriate variables:
get.sourceData()
- Apply the analysis-specific variable function:
varfun.ABC.#()
- Apply the analysis listed in column
stat.test
to the data - Organise the output
get.desriptives()
- Calculate confidence intervals for effect sizes
any2any()
- Return the ouput
- Get information from
masteRkey
on the analyses to run:get.info()
- Get a data filter based on exclusion criteria:
get.chain()
- Select the appropriate variables:
get.sourceData()
- Apply the analysis-specific variable function:
varfun.ABC.#()
- Apply the analysis listed in column
stat.test
to the data - Organise the output
get.desriptives()
- Calculate confidence intervals for effect sizes
any2any()
- Return the ouput