TG_analysis | R Documentation |

Given an choice ingter-valued index matrix and a vector of numbers of item options, the function cycles through a set of iterations involving surprisal curve estimation followed by test taker index values.

```
TG_analysis(chcemat, scoreList, noption, sumscr_rng=NULL,
titlestr=NULL, itemlabvec=NULL, optlabList=NULL,
nbin=nbinDefault(N), NumBasis=7, NumDensBasis=7,
jitterwrd=TRUE, PcntMarkers=c( 5, 25, 50, 75, 95),
ncycle=10, itdisp=FALSE, verbose=FALSE)
```

`chcemat` |
An N by n matrix. Column i must contain the integers from 1 to M_i, where M_i is the number of options for item i. If missing or illegitimate responses exist for item i, the column must also contain an integer greater than M_i that is used to identify such responoses. Alternatively, the column use NA for this purpose. Because missing and illegible responses are normally rare, they are given a different and simpler estimation procedure for their surprisal values. U is mandatory. |

`scoreList` |
Either a list of length n, each containing a vector of length M_i that assigns numeric weights to the options for that item. In the special case of multiple choice items where the correct option has weight 1 and all others weight 0, a single integer can identify the correct answer. If all the items are of the multiple type, scoreList may be a numeric vector of length n containing the right answer indices. List object scoreList is mandatory because these weights define the person scores for the surprisal curve estimation process. |

`noption` |
A numeric vector of length |

`sumscr_rng` |
A vector of length 2 indicating the initial and final sum score values. Default is NULL the whole sum score is used. |

`titlestr` |
A title string for the data and their analyses. Default is NULL. |

`itemlabvec` |
A character value containing labels for the items. Default is NULL and item position numbers are used. |

`optlabList` |
A list vector of length n, each element i of which is a character vector of length M_i. Default is NULL, and option numbers are used. |

`nbin` |
The number of bins containing proportions of choices. |

`NumBasis` |
The number of spline basis functions to use for surprisal values. Defaults to 7. |

`NumDensBasis` |
The number of spline basis functions to use for score probability density function. Defaults to 7. |

`jitterwrd` |
A logical object indicating whether a small jittering perturbation should be used to break up ties. Defaults to TRUE. |

`PcntMarkers` |
A vector of percentages inside of [0,100] that appear in plots. Defaults to c(5, 25, 50, 75, 95). Extra displays are provided. Defaults to FALSE. |

`ncycle` |
The number of cycles in the analysis. Defaults to 10. |

`itdisp` |
Display results for function |

`verbose` |
Extra displays are provided. Defaults to FALSE. |

This function in package TestGardener processes at a mininum two objects:
(1) A matrix `chcemat`

that contains indices of choices made in a
sequence of choice situations (its number columns `n`

) by a set of
persons making the choices (its number of rows `N`

); and
(2) A list vector `scoreList`

of length `n`

containing numerical
weights or scores for each choice available with in each of `n`

choice
situations (referred to as `items`

).

The function returns three large lists containing objects that can be used
to assess:
(1) the probability that a choice will be made, and
(2) the quantity of information, called `surprisal`

, that the choice
made reveals about the performance or experience of the person making the
choice.

Four list objects, each containing objects that are required for various displays, tables and other results:

`parmList` |
A list object containing objects useful for displaying results that involve the score index cotninuum: |

SfdList: A list object of length n, each containing objects for an item for displaying that item's surprisal curves as defined by the score index values after the analysis. See the help page for function

`Analyze`

for a description of these objects.Qvec: A vector containing the positions on the score index continuum of the marker percentages defined in the arguments of function

`make_dataList()`

.binctr: A vector of length

`nbin`

containing the positions on the score index continuum of the bin centres.indexScore: A vector of length

`N`

containing the positions on the score index contiuum of each person.infoSurp: The length of the test or scale information continuum in M-bits.

`infoList` |
A list object containing objects useful for displaying results that involve the scale information cotninuum: |

infofine: A fine mesh of 101 values that is used to plot the scale information comntinuum.

scopevec: A vector of length

`N`

containing the positions on the scale information contiuum of each person.Qinfovec: A vector containing the positions on the scale information continuum of the marker percentages defined in the arguments of function

`make_dataList()`

.infobinctr: A vector of length

`nbin`

containing the positions on the scale information continuum of the bin centres.

`HALsave` |
A |

`analysisListvec` |
A list of length |

Juan Li and James Ramsay

Ramsay, J. O., Li J. and Wiberg, M. (2020) Full information optimal scoring. Journal of Educational and Behavioral Statistics, 45, 297-315.

Ramsay, J. O., Li J. and Wiberg, M. (2020) Better rating scale scores with information-based psychometrics. Psych, 2, 347-360.

```
make_dataList,
Analyze,
index_distn,
index2info,
index_fun,
Sbinsmth
```

```
## Not run:
# Example 1: Input choice data and key for the short version of the
# SweSAT quantitative multiple choice test with 24 items and 1000 examinees
# input the choice indices in the 1000 by 24 choice index matrix
chcemat <- Quant_13B_problem_chcemat
# set up the key data
key <- Quant_13B_problem_key
# number of examinees and of items
N <- nrow(chcemat)
n <- ncol(chcemat)
# number of options per item and option weights
noption <- rep(0,n)
for (i in 1:n) noption[i] <- 4
scoreList <- list() # option scores
for (item in 1:n){
scorei <- rep(0,noption[item])
scorei[key[item]] <- 1
scoreList[[item]] <- scorei
}
# Analyze the data and return the big three list objects:
# dataList (input info), parmList (score index info) and
# infoList (information or scope info)
TGresult <- TG_analysis(chcemat, scoreList, noption,
NumBasis=4, ncycle=10, verbose=TRUE)
## End(Not run)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.