R, Standard error (IRT) Plotting an inverse function -
i following tutorial on creating information functions, completed tutorial looking take 1 more step , have been stalemated. tutorial following below.
irt.4pm.info <- function(theta,item.par,d=1.7) { # function calculates fisher information # 4 parameter model, given item parameters , ability. # # item.par should matrix 4 columns: # each row represents item, # first column represents parameters (item discrimination) # second column represents b parameters (item difficulty) # third column represents c parameters(pseudo-guessing parameter) # fourth column represents d parameters (upper asymptote) # theta can single number or vector. return(t(sapply(theta, fun = function (x) ( (d * item.par[,1])^2 * (item.par[,4] - item.par[,3])^2)/ ((item.par[,3] + item.par[,4] * exp(d*item.par[,1] * (x - item.par[,2]))) * (1 - item.par[,3] + (1-item.par[,4]) * exp(d*item.par[,1] * (x-item.par[,2]))) * (1 + exp(-d * item.par[,1] * (x - item.par[,2])))^2) ))) } theta.2 <- c(-1,-.5,0,1,2) itpars <- data.frame(a = c(1, 1,.75), b = c(0,-.5, 1), c = c(0, 0, .2), d = c(1, 1,.98)); itpars ## b c d ## 1 1.00 0.0 0.0 1.00 ## 2 1.00 -0.5 0.0 1.00 ## 3 0.75 1.0 0.2 0.98 theta.3 <- seq(-4,4,by=0.01) item.1.pars <- data.frame(a=1.2,b=-0.6,c=.1,d=1) plot(theta.3,irt.4pm.info(theta.3,item.1.pars),type="l", main="information functon", xlab="theta", ylab="information")
what looking plot inverse of function have right now. is, function looks bell curve , have inverse of function (upside down bell curve)
the curve looking make standard error reciprocal of information se = 1/i^.5 (i=information)
Comments
Post a Comment