gpt_gen: Generate Single Data Set

View source: R/gen_gpt.R

gpt_genR Documentation

Generate Single Data Set

Description

Generate Single Data Set

Usage

gpt_gen(n, theta, eta, file, latent, restrictions = NULL)

Arguments

n

vector of the length of number of trees with n per tree

theta

vector of true MPT parameter values (consider also restricted parameters!). Values will be appropriatly reordered if a named vector ist given (otherwise, check order!).

eta

vector of true continuous parameters. Values will be appropriatly reordered if a named vector ist given (otherwise, check order!).

file

a character vector specifying the path to the model file

latent

type of latent continuous distribution (one of "normal", "exgauss", "exwald", "gamma", "weibull", "lognormal", "wald", or beta). Can be a vector if multiple continuous variables y have different distributions (e.g., latent = c("normal", "gamma"))

restrictions

list with parameter restrictions (e.g., list("g=0.5", "mean1=mean2=100"))

See Also

gpt_gen_sample

Examples

###### 2-High-Threshold Model (+2 normal distributions) ######

### parameters
n <- c(targets=20, lures=20)     # number of items
theta <- c(do=.6, g=.5)          # MPT parameters
eta <- c(m1_d=100, m1_g=110, s1=10,
         m2_d=30, m2_g=50, s2=5)     # normal distributions
file <- paste0(path.package("gpt"), "/models/2htm_2normal.txt")

gen <- gpt_gen(n=n, theta=theta, eta=eta, file=file,
              latent=c("normal", "normal"), restrictions=list("do=dn"))
head(gen) 
# check means of latent continuous distributions:
tapply(gen$y.1, gen$state, mean)


danheck/gpt documentation built on Feb. 12, 2024, 6:21 a.m.