make_mystandata: make_mystandata

View source: R/make_mystandata.R

make_mystandataR Documentation

make_mystandata

Description

aim: create data that can passed in to stan. Variables will be passed as subject x trial matrices. These matrices are padded with Inf value to have exactly the same number of trials despite missing values

Usage

make_mystandata(
  data,
  subject_column,
  block_column,
  var_toinclude,
  var_tobenamed,
  additional_arguments
)

Arguments

data

is your data frame

subject_column
  • is the specific vector of subjects from you data frame (e.g., data$subject)

block_column
  • is the specific vector of subjects from you data frame (e.g., data$block)

var_toinclude
  • is a vector of strings with the names of data columns that should be included in the stan data

var_tobenamed
  • is a vector of strings for how to variables should be names according to stan model (in case the data and stan has different names for the same var)

Ntrials_per_subject
  • is a vector 1 x Nsubj with each cell including the number of available trials per subject

Examples

## Not run: 
stan_data=
make_mystandata(
data=df,
subject_column=df$subject,
block_column = df$block,
Ntrials_per_subject = 200,
var_toinclude = c("stay","ch_key","ch_card")
var_tobenamed = c("stay_card","chosen_key","chosen_card")
)

## End(Not run)

shahar-lab/RLR documentation built on March 2, 2024, 4:40 a.m.