estheta: A estimation theta function.

Description Usage Arguments Value Author(s) Examples

View source: R/estheta.R

Description

A estimation theta function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
estheta(
  xall,
  param,
  est = "EAP",
  nofrands = 10,
  method = "NR",
  file = "default",
  output = FALSE,
  IDc = 1,
  gc = 2,
  fc = 3,
  gh = TRUE,
  N = 31,
  D = 1.702,
  maxtheta = 4,
  mintheta = -4,
  mu = 0,
  sigma = 1,
  sampling_engine = "rejection_Cpp",
  warm_up = 100
)

Arguments

xall

a item response data

param

a item parameter file.If class is df, parameter column must be "a", "b" and "c". If class is matrix, you should set a parameter in first column, b parameter in second and c in third.

est

estimation method option. "EAP","MAP","MLE","PVs."

nofrands

the number of PVs.

method

iteration method option in MLE and MAP. "NR" is Newton Rapthon, "SANN" is Simulated Aannealing, "Brent" is optimization using optimise function

file

a name of output csv file.

output

logical. If TRUE write csv file. defauli is FALSE.

IDc

colomn of ID, default is 1.Even If df has no ID columns this function works.

gc

column of group or population numbers. If df has no grouo ID, set 0.

fc

column of first item response, default is 3.

gh

logical. If TRUE, is default, gaussHermite quadrature runs for EAP estimation.

N

the number of nodes. default is 31.

D

a factor constant. deafault is 1.702.

maxtheta

the maximul value of theta in integration.

mintheta

the minimum value of theta in integration.

mu

a hyperparameter of prior distribution.

sigma

same as above.

sampling_engine

an option of sampling engine. if select "rejection_R", the rejection samplimg method is conducted and this engine loop witten in R lang this is so somewhat slow, but "rejection_Cpp" is for loop in C++ lang so very fast. If select "slice_R" , the slice sampling method will be conducted.

warm_up

the number of iteration times for warm up in slice sampling

Value

a list has ID, rawscore, theta, se, person fit index Z3 and log likelihood.

Author(s)

Takumi, Shibuya., Daisuke, Ejiri., Tadashi, Shibayama. in Tohoku University.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(123)
theta <- rnorm(200)
b <- rnorm(15)
a <- rlnorm(15,0,0.5)
c <- rep(0,15)
data <- irtfun2::sim_gen(theta,a,b,c)
para <- cbind(a,b,c)
pv <- estheta(data, param = para, est = "PVs", gc = 0, fc = 2)

head(pv$OVs_df)

takuizum/irtfun2 documentation built on May 10, 2020, 8:30 a.m.