gpt_gen | R Documentation |
Generate Single Data Set
gpt_gen(n, theta, eta, file, latent, restrictions = NULL)
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 |
restrictions |
list with parameter restrictions (e.g., |
gpt_gen_sample
###### 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.