|
1 | 1 | ## File Name: IRT.informationCurve.R |
2 | | -## File Version: 9.19 |
| 2 | +## File Version: 9.212 |
3 | 3 |
|
4 | 4 |
|
5 | 5 |
|
@@ -47,25 +47,19 @@ informationCurves_mml <- function( object, h=.0001, |
47 | 47 | B=B, xsi=xsi, theta=theta, nnodes=nnodes, |
48 | 48 | maxK=maxK, recalc=TRUE) |
49 | 49 |
|
50 | | - #**** |
51 | | - # calculate probabilities |
52 | | - if ( class(object) %in% c("tam.mml","tam.mml.2pl", "tam.mml.mfr") ){ |
| 50 | + #--- calculate probabilities |
| 51 | + if ( inherits(object, c("tam.mml","tam.mml.2pl", "tam.mml.mfr") ) ){ |
53 | 52 | fct <- "tam_calc_prob" |
54 | | - p0 <- do.call( what=fct, args=calc_args )$rprobs |
55 | | - p1 <- do.call( what=fct, args=tam_args_replace_value( args=calc_args, |
56 | | - variable="theta", value=theta+h ) )$rprobs |
57 | | - p2 <- do.call( what=fct, args=tam_args_replace_value( args=calc_args, |
58 | | - variable="theta", value=theta-h ) )$rprobs |
59 | 53 | } |
60 | | - if ( class(object) %in% c("tam.mml.3pl" ) ){ |
| 54 | + if ( inherits(object, c("tam.mml.3pl") ) ){ |
61 | 55 | calc_args$guess <- guess |
62 | 56 | fct <- "tam_mml_3pl_calc_prob" |
63 | | - p0 <- do.call( what=fct, args=calc_args )$rprobs |
64 | | - p1 <- do.call( what=fct, args=tam_args_replace_value( args=calc_args, |
65 | | - variable="theta", value=theta+h ) )$rprobs |
66 | | - p2 <- do.call( what=fct, args=tam_args_replace_value( args=calc_args, |
67 | | - variable="theta", value=theta-h ) )$rprobs |
68 | 57 | } |
| 58 | + p0 <- do.call( what=fct, args=calc_args )$rprobs |
| 59 | + args1 <- tam_args_replace_value( args=calc_args, variable="theta", value=theta+h ) |
| 60 | + p1 <- do.call( what=fct, args=args1 )$rprobs |
| 61 | + args2 <- tam_args_replace_value( args=calc_args, variable="theta", value=theta-h ) |
| 62 | + p2 <- do.call( what=fct, args=args2 )$rprobs |
69 | 63 | p0a <- p0 |
70 | 64 | p0[ is.na(p0) ] <- 0 |
71 | 65 | p1[ is.na(p1) ] <- 0 |
|
0 commit comments