Title: | My Computerized Adaptive Assessment |
---|---|
Description: | Implementation of adaptive assessment procedures based on Knowledge Space Theory (KST) and Formal Psychological Assessment (FPA) frameworks. An adaptive assessment is a type of evaluation that adjusts the difficulty and nature of subsequent questions based on the test-taker's responses to previous ones. The package contains functions to perform and simulate an adaptive assessment. Moreover, it is integrated with two 'Shiny' interfaces, making it both accessible and user-friendly. The package has been funded by the European Union - NextGenerationEU and by the Ministry of University and Research (MUR), National Recovery and Resilience Plan (NRRP), Mission 4, Component 2, Investment 1.5, project “RAISE - Robotics and AI for Socio-economic Empowerment” (ECS00000035). |
Authors: | Andrea Brancaccio [aut, cph, cre] , Umberto Granziol [aut, ctb] |
Maintainer: | Andrea Brancaccio <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2024-11-12 06:28:19 UTC |
Source: | https://github.com/brancaccioandrea/mycaas |
The dataset contains a six items test concerning basic knowledge on computerized adaptive assessment. This test has been developed during the creation of this R package.
AA_knowledge_test
AA_knowledge_test
A assessment object based on six multiple choice items.
Structure with six items and twelve states.
Uniformly distributed across the states.
The stopping rules is "likelihood_maximization" with a criterion of .5.
Six multiple choice items.
The value is set on TRUE allowing adaptive administration.
The value is set on FALSE not allowing items repetition.
Created to serve as an Example for this package.
data(AA_knowledge_test) #Lazy loading
data(AA_knowledge_test) #Lazy loading
Function that performs computerized assessment
assessment( likelihood = NA, states, beta, eta, questioning_rule = "half_split", termination = "likelihood_maximization", SC = 0.5, N_items = NULL, ki = 1, textq = NULL, textr = NULL, repetition = FALSE, adaptive = TRUE, simulation = TRUE, interactiveplot = FALSE )
assessment( likelihood = NA, states, beta, eta, questioning_rule = "half_split", termination = "likelihood_maximization", SC = 0.5, N_items = NULL, ki = 1, textq = NULL, textr = NULL, repetition = FALSE, adaptive = TRUE, simulation = TRUE, interactiveplot = FALSE )
likelihood |
A vector of the likelihood distribution on the states in the structure. |
states |
A state-by-problem matrix representing the structure, where an element is one if the item is included in the state, and zero otherwise. |
beta |
Vector of careless error probabilities. |
eta |
Vector of lucky guess error probabilities. |
questioning_rule |
A function which is used a questioning rules for the assessment. the default questioning rule is 'half_split'. |
termination |
Define and select one of the termination criteria: "likelihood_maximization" the assessment terminates when the likelihood of a knowledge state in a knowledge structure became higher of the termination criteria (Heller, and Repitsch, 2012). "items_discrimination" the assessment terminates if the marginal likelihood of all the items is outside the interval of the stopping criteria (Donadello, Spoto, Sambo, Badaloni, Granziol, Vidotto, 2017). |
SC |
The Stopping criterion for the assessment is a numeric vector of values between 0 and 1. When the "termination" parameter is "likelihood_maximization" this is a single scalar that corresponds to the likelihood that a knowledge state needed to terminates the assessment. When the "termination" parameter is "items_discrimination" this is a numeric vector of length two, the assessment terminate if the the marginal likelihood of each item is outside of the interval between the two elements. |
N_items |
Number of items in the test. Optional entry in case of adaptive = FALSE. |
ki |
A number indicating the row in the structure to simulate as the true knowledge states. |
textq |
A character vector containing the text of the questions. |
textr |
A list containing for each question the correct and incorrect answers. |
repetition |
Logical value. When the value is TRUE the assessment procedure is allowed to administer the same item more then one time. |
adaptive |
Logical value. When the value is TRUE the assessment proceed with an adaptive procedure, otherwise the items presentation is randomized |
simulation |
Logical value. When the value is TRUE the assessment proceed with simulating a complete assessment with a user knowledge state define in variable ki. Otherwise the assessment collect answer from the user. |
interactiveplot |
Logical value. When the value is TRUE the knowledge structure is plot using a color thermometer scale to represents the likelihood of the states. |
The outcome of a single assessment.
Doignon, J.-P., & Falmagne, J.-C. (1999). Knowledge spaces. Springer.
Donadello, I., Spoto, A., Sambo, F., Badaloni, S., Granziol, U., & Vidotto, G. (2017). ATS-PD: An adaptive testing system for psychological disorders. Educational and psychological measurement, 77(5), 792-815.
Heller, J., & Repitsch, C. (2012). Exploiting prior information in stochastic knowledge assessment. Methodology.
# Example 1: From Brancaccio,de Chiusole, Stefanutti (2023) # Consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) likelihood <-rep(1,nrow(states))/nrow(states) assessment(likelihood,states,beta,eta) # Example 2: Random items presentation assessment(N_items = 5 ,adaptive = FALSE) # Example 3: Interactive mode on in the console TextQuestion<-c("I frequently use computers.", "I know how to build an assessment instrument (i.e., a paper-and-pencil questionnaire).", "I can code and implement a 'for' loop (independently of its purpose).", "When you administer an adaptive assessment, each question: ", "I usually programme or code my assessment tools ", "I add my assessment in a programme (i.e , google form) ") TextResponse<-list( correct=list("Yes","Yes","Yes","depend from the previous questions","Yes","Yes"), incorrect=list(c("No"),c("No"),c("No"),c("is independent from the others questions", "depend from the gender of the interviewed"),c("No"),c("No")) ) map <- matrix(c(1,0,0,0, 0,1,0,0, 1,0,1,0, 0,1,0,1, 1,1,1,0, 1,1,0,0), ncol=4) skillmap<-cbind(1:6,map) states<-pks::delineate(skillmap)$K rownames(states)<-NULL eta <- rep(0.1,ncol(states)) beta <- rep(0.1,ncol(states)) likelihood <-rep(1,nrow(states))/nrow(states) ## Not run: token <- assessment(likelihood,states,beta,eta,textq=TextQuestion, textr=TextResponse,simulation=FALSE) ## End(Not run)
# Example 1: From Brancaccio,de Chiusole, Stefanutti (2023) # Consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) likelihood <-rep(1,nrow(states))/nrow(states) assessment(likelihood,states,beta,eta) # Example 2: Random items presentation assessment(N_items = 5 ,adaptive = FALSE) # Example 3: Interactive mode on in the console TextQuestion<-c("I frequently use computers.", "I know how to build an assessment instrument (i.e., a paper-and-pencil questionnaire).", "I can code and implement a 'for' loop (independently of its purpose).", "When you administer an adaptive assessment, each question: ", "I usually programme or code my assessment tools ", "I add my assessment in a programme (i.e , google form) ") TextResponse<-list( correct=list("Yes","Yes","Yes","depend from the previous questions","Yes","Yes"), incorrect=list(c("No"),c("No"),c("No"),c("is independent from the others questions", "depend from the gender of the interviewed"),c("No"),c("No")) ) map <- matrix(c(1,0,0,0, 0,1,0,0, 1,0,1,0, 0,1,0,1, 1,1,1,0, 1,1,0,0), ncol=4) skillmap<-cbind(1:6,map) states<-pks::delineate(skillmap)$K rownames(states)<-NULL eta <- rep(0.1,ncol(states)) beta <- rep(0.1,ncol(states)) likelihood <-rep(1,nrow(states))/nrow(states) ## Not run: token <- assessment(likelihood,states,beta,eta,textq=TextQuestion, textr=TextResponse,simulation=FALSE) ## End(Not run)
Rule to select the most informative item at each step of the assessment.
half_split(likelihood, states, beta, eta, Q_pool = NA)
half_split(likelihood, states, beta, eta, Q_pool = NA)
likelihood |
A vector of the likelihood distribution on the states in the structure. |
states |
A state-by-problem matrix representing the structure, where an element is one if the item is included in the state, and zero otherwise. |
beta |
Vector of careless error probabilities. |
eta |
Vector of lucky guess error probabilities. |
Q_pool |
A vector contains the pool of items for the assessment in this moment of the procedure. |
The item that maximizes the information (for details see, Doignon and Falmagne, 2012).
Doignon, J.-P., & Falmagne, J.-C. (1999). Knowledge spaces. Berlin: Springer.
# Consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) likelihood <-c(0,0,0,0,0,1/3,0,1/3,0,0,1/3) Q_pool <- c(2,4,5) half_split(likelihood,states,beta,eta,Q_pool)
# Consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) likelihood <-c(0,0,0,0,0,1/3,0,1/3,0,0,1/3) Q_pool <- c(2,4,5) half_split(likelihood,states,beta,eta,Q_pool)
Simulation producing efficiency and accuracy performance curves and indexes based on simulated assessment of all the states in structure
performance_simulation( states, beta, eta, likelihood = NA, questioning_rule = "half_split", nrep = 1 )
performance_simulation( states, beta, eta, likelihood = NA, questioning_rule = "half_split", nrep = 1 )
states |
A state-by-problem matrix representing the structure, where an element is one if the item is included in the state, and zero otherwise. |
beta |
Vector of careless error probabilities. |
eta |
Vector of lucky guess error probabilities. |
likelihood |
A vector of the likelihood for each state, if omitted the initial likelihood is assumed equally distributed. |
questioning_rule |
A function which is used a questioning rules for the assessment. the default questioning rule is 'half_split'. |
nrep |
Number of times in which each state is simulated. The default value is one. |
Efficiency and Accuracy curves plots.
# Consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) performance_simulation(states,beta,eta)
# Consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) performance_simulation(states,beta,eta)
Function used to plot an assessment object.
## S3 method for class 'assessment' plot(x, bg_color = NULL, verices_color = "black", ...)
## S3 method for class 'assessment' plot(x, bg_color = NULL, verices_color = "black", ...)
x |
Assessment object to display. |
bg_color |
Background color. The default is white. |
verices_color |
Color of the nodes label. |
... |
Additional arguments affecting the summary produced. |
The function returns the graph representation of the structure.
# Example: Random items presentation token<- assessment(N_items = 5 ,adaptive = FALSE) plot(token)
# Example: Random items presentation token<- assessment(N_items = 5 ,adaptive = FALSE) plot(token)
Function to print in the console the item and collect the answer.
print_question( TextQuestion, TextResponse = list(correct = "correct", incorrect = c("wrong1", "wrong2", "wrong3")) )
print_question( TextQuestion, TextResponse = list(correct = "correct", incorrect = c("wrong1", "wrong2", "wrong3")) )
TextQuestion |
A character contain the text of the question. |
TextResponse |
A list containing for each question the correct and incorrect answers. |
The answers of the question as numeric (1) if is correct and (0) if is false.
This function run a shinyApp in which the is available: iii) The GUI implementation of the adaptive assessment
run_Assessment(file = NULL)
run_Assessment(file = NULL)
file |
Logical value. |
The results of the assessment
# Try the test example yourself data(AA_knowledge_test) if(interactive()){ run_Assessment(AA_knowledge_test)}
# Try the test example yourself data(AA_knowledge_test) if(interactive()){ run_Assessment(AA_knowledge_test)}
This function run a shinyApp in which the following pages are available: i) a brief introduction of the assessment tools; ii) the GUI to create "assessment" files from a "csv" of items; iii) the GUI implementation of the adaptive assessment; and iv) the GUI implementation of the outcome.
run_Practice()
run_Practice()
The results of the assessment
# Try to build your test if(interactive()){ run_Practice()}
# Try to build your test if(interactive()){ run_Practice()}
Rule to decide when terminate the assessment
stopping_criterion( likelihood, states, termination = "likelihood_maximization", SC = c(0.8) )
stopping_criterion( likelihood, states, termination = "likelihood_maximization", SC = c(0.8) )
likelihood |
A vector of the likelihood distribution on the states in the structure. |
states |
A state-by-problem matrix representing the structure, where an element is one if the item is included in the state, and zero otherwise. |
termination |
Define and select one of the termination criteria: "likelihood_maximization" the assessment terminates when the likelihood of a knowledge state in a knowledge structure became higher of the termination criteria (Heller, and Repitsch, 2012). "items_discrimination" the assessment terminates if the marginal likelihood of all the items is outside the interval of the stopping criteria (Donadello, Spoto, Sambo, Badaloni, Granziol, Vidotto, 2017). |
SC |
The Stopping criterion for the assessment is a numeric vector of values between 0 and 1. When the "termination" parameter is "likelihood_maximization" this is a single scalar that corresponds to the likelihood that a knowledge state needed to terminates the assessment. When the "termination" parameter is "items_discrimination" this is a numeric vector of length two, the assessment terminate if the the marginal likelihood of each item is outside of the interval between the two elements. |
Return TRUE if the assessment should terminates under the criteria, otherwise FALSE
Donadello, I., Spoto, A., Sambo, F., Badaloni, S., Granziol, U., & Vidotto, G. (2017). ATS-PD: An adaptive testing system for psychological disorders. Educational and psychological measurement, 77(5), 792-815.
Heller, J., & Repitsch, C. (2012). Exploiting prior information in stochastic knowledge assessment. Methodology.
# Consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) likelihood <-c(0,0,0,0,0,0,0,.49,0,0,.51) #stopping criterion based on the likelihood mode stopping_criterion(likelihood,states, termination="likelihood_maximization" ,SC=c(0.5)) #stopping criterion based on the items marginal probabilities stopping_criterion(likelihood,states, termination="items_discrimination" ,SC=c(0.2,0.8))
# Consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) likelihood <-c(0,0,0,0,0,0,0,.49,0,0,.51) #stopping criterion based on the likelihood mode stopping_criterion(likelihood,states, termination="likelihood_maximization" ,SC=c(0.5)) #stopping criterion based on the items marginal probabilities stopping_criterion(likelihood,states, termination="items_discrimination" ,SC=c(0.2,0.8))
Function used to produce result summaries of an assessment object.
## S3 method for class 'assessment' summary(object, ...)
## S3 method for class 'assessment' summary(object, ...)
object |
Assessment object to display |
... |
Additional arguments affecting the summary produced. |
The function return a summary of the information in the a assessment object
# Example of random items presentation token<- assessment(N_items = 5 ,adaptive = FALSE, ki=15) summary(token)
# Example of random items presentation token<- assessment(N_items = 5 ,adaptive = FALSE, ki=15) summary(token)
Multiplicative rule as in Falmagne and Doignon 2010 (Chapter 13, Section 10)
updating(likelihood, states, q, r_q, beta, eta)
updating(likelihood, states, q, r_q, beta, eta)
likelihood |
A vector of the likelihood distribution on the states in the structure. |
states |
A state-by-problem matrix representing the structure, where an element is one if the item is included in the state, and zero otherwise. |
q |
Last administered item |
r_q |
Observed response to item q |
beta |
Vector of careless error probabilities |
eta |
Vector of lucky guess error probabilities |
The updated likelihood distribution on the knowledge states
# Let consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) likelihood_0 <-rep(1,nrow(states))/nrow(states) # Item asked q = 3 # response observed r_q = 1 likelihood_1 <- updating(likelihood_0,states,q,r_q,beta,eta)
# Let consider the knowledge space and the parameters used in Brancaccio, # de Chiusole, Stefanutti (2023) in Example 1 states<-matrix(c( 0,0,0,0,0, 0,0,0,0,1, 0,0,1,0,1, 0,0,0,1,1, 0,0,1,1,1, 1,0,1,0,1, 0,1,0,1,1, 1,0,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1), byrow=TRUE, ncol=5) beta <-c(.004,.03,.02,.01,.007) eta <-c(5e-06, 5e-05, 4e-05,.007,.08) likelihood_0 <-rep(1,nrow(states))/nrow(states) # Item asked q = 3 # response observed r_q = 1 likelihood_1 <- updating(likelihood_0,states,q,r_q,beta,eta)