Learn R Programming

ggdmc (version 0.1.3.9)

data.model.dmc: Bind Data and Models

Description

Binding a data frame and a DMC model description. This function also check if they are compatible and adding a cell.index and many other attributes to the data frame in order to speed likelihood computation.

Usage

data.model.dmc(data, model)

Arguments

data
a data frame stored choice-RT data
model
a DMC model

Details

data.model.dmc adds a dmc class.

Examples

Run this code
m1 <- model.dmc(
   p.map     = list(a="1",v="1",z="1",d="1",sz="1",sv="1", t0="1",st0="1"),
   constants = c(st0=0,d=0),
   match.map = list(M=list(s1="r1",s2="r2")),
   factors   = list(S=c("s1","s2")),
   responses = c("r1","r2"),
   type      = "rd")

pVec <- c(a=1,v=1, z=0.5, sz=0.25, sv=0.2,t0=.15)
dat1 <- simulate(m1, nsim=1e2, p.vector=pVec)
mdi1 <- data.model.dmc(dat1, m1)
class(mdi1)
## [1] "data.frame"        "dmc"

Run the code above in your browser using DataLab