knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

stacmr

Travis build status

The goal of stacmr is to provide functionality for state-trace analysis via conjoint monotonic regression. The main function for this is cmr(). In addition, it provides functionality for fitting monotonic regression models with function mr().

Installation

You can install the released version of stacmr from CRAN with:

## NOT YET AVAILABLE FROM CRAN

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("monotonicity/stacmr")

Example

This is a basic example.

library(stacmr)
## load data from Exp. 1 of Dunn, Newell, & Kalish (2012)
data(delay)
str(delay, width = 78, strict.width = "cut")

stats <- sta_stats(
  data = delay, 
  col_value = "pc", 
  col_participant = "participant",
  col_dv = "structure", 
  col_within = "block", 
  col_between = "delay"
)
stats


### cmr() fits conjoint monotonic regression for state-trace analysis
## Fit and test CMR State-Trace Analysis Model
st_d1 <- cmr(
  data = delay, 
  col_value = "pc", 
  col_participant = "participant",
  col_dv = "structure", 
  col_within = "block", 
  col_between = "delay", 
  nsample = 1e4
)
st_d1  ## basic information about conjoint-monotonic model

summary(st_d1)  ## basic information plus estimated cell means

### cmr() also accepts partial order. 
## CMR model is tested against MR model with partial order 
st_d3 <- cmr(
  data = delay, 
  col_value = "pc", 
  col_participant = "participant",
  col_dv = "structure", 
  col_within = "block", 
  col_between = "delay", 
  partial = "auto"
)
st_d3
summary(st_d3)


monotonicity/stacmr documentation built on Jan. 28, 2020, 3:29 a.m.