| Title: | Predictions Using Item-Focused Tree Models |
|---|---|
| Description: | This function predicts item response probabilities and item responses using the item-focused tree (IFT) model. The IFT model combines logistic regression with recursive partitioning to detect Differential Item Functioning (DIF) in dichotomous items. The model applies partitioning rules to the data, splitting it into homogeneous subgroups, and uses logistic regression within each subgroup to explain the data. DIF detection is achieved by examining potential group differences in item response patterns. This method is useful for understanding how different covariates, such as demographic or psychological factors, influence item responses across subpopulations. |
| Authors: | Muditha Bodawatte Gedara [aut, cre], Barret Mochka [aut], Lisa Lix [aut] |
| Maintainer: | Muditha Bodawatte Gedara <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-11 07:05:06 UTC |
| Source: | https://github.com/mudithabo/iftpredictor |
A dataset used for demonstrating the IFTPredictor package. This dataset includes response data (columns 1-20) and covariate data (columns 21-24)
mydatamydata
A data frame with 500 rows and 24 variables:
Binary response variable (numeric: 0 or 1) representing item 1.
Binary response variable (numeric: 0 or 1) representing item 2.
Binary response variable (numeric: 0 or 1) representing item 3.
Binary response variable (numeric: 0 or 1) representing item 4.
Binary response variable (numeric: 0 or 1) representing item 5.
Binary response variable (numeric: 0 or 1) representing item 6.
Binary response variable (numeric: 0 or 1) representing item 7.
Binary response variable (numeric: 0 or 1) representing item 8.
Binary response variable (numeric: 0 or 1) representing item 9.
Binary response variable (numeric: 0 or 1) representing item 10.
Binary response variable (numeric: 0 or 1) representing item 11.
Binary response variable (numeric: 0 or 1) representing item 12.
Binary response variable (numeric: 0 or 1) representing item 13.
Binary response variable (numeric: 0 or 1) representing item 14.
Binary response variable (numeric: 0 or 1) representing item 15.
Binary response variable (numeric: 0 or 1) representing item 16.
Binary response variable (numeric: 0 or 1) representing item 17.
Binary response variable (numeric: 0 or 1) representing item 18.
Binary response variable (numeric: 0 or 1) representing item 19.
Binary response variable (numeric: 0 or 1) representing item 20.
An integer variable (e.g., a grouping factor or categorical covariate).
A continuous numeric covariate.
An integer variable (binary: 0 or 1).
A continuous numeric covariate.
data("mydata", package = "IFTPredictor") head(mydata)data("mydata", package = "IFTPredictor") head(mydata)
This function predicts item response probabilities and item responses using the item-focused tree (IFT) model. The IFT model combines logistic regression with recursive partitioning to detect Differential Item Functioning (DIF) in dichotomous items. The model applies partitioning rules to the data, splitting it into homogeneous subgroups, and uses logistic regression within each subgroup to explain the data. DIF detection is achieved by examining potential group differences in item response patterns. This model produces tree diagrams to visualize homogeneous subgroups within the population exhibiting similar response patterns and may therefore be helpful for developing personalized interventions and optimizing resource allocation in healthcare.
predict_item_responses(model, dataset, total_score)predict_item_responses(model, dataset, total_score)
model |
A DIFtree model object. |
dataset |
A data frame containing the required data. The 'total_score' column must be included. |
total_score |
The name of the column in the dataset representing the total score (e.g., "total_score"). |
The logistic regression model for the -th PROM item is defined as:
where,
: The response of person to the -th item.
: The number of persons.
: The number of items.
: Group membership ( for the reference group, for the focal group).
: The ability level (e.g., total PROM score) of person .
: The intercept or item difficulty parameter.
: The slope or item discrimination parameter.
: The group-specific parameter.
The IFT model extends this logistic regression model for DIF detection for the -th PROM item:
where,
: The number of partitions.
: The threshold for the -th variable.
and : The subgroups defined by tree partitions.
: The indicator function (1 if true, 0 otherwise).
and : Subgroup-specific intercepts for logistic regression models in partitioned regions.
The terminal or leaf nodes of the tree represent the final groups of patients with similar response patterns.
The IFT model assumes unidimensionality, and the covariates can be either continuous or categorical.
If an item is never chosen for splitting, it is assumed to be free of DIF. The equation for an item free of DIF can be defined as:
A list containing:
equations |
A set of logistic regression equations generated for each item. |
predictions |
A dataset with predicted probabilities ( |
Muditha Bodawatte Gedara ([email protected]), Barret Monchka, Lisa Lix
Berger, Moritz and Tutz, Gerhard (2016): Detection of Uniform and Non-Uniform Differential Item Functioning by Item Focused Trees, Journal of Educational and Behavioral Statistics 41(6), 559-592.
DIFtree for training the DIFtree model.
if (requireNamespace("DIFtree", quietly = TRUE)) { # Load DIFtree library(DIFtree) # Load the dataset data("mydata", package = "IFTPredictor") # Observe the data head(mydata) # Extract response and covariate data Y <- mydata[, 1:20] # Item responses X <- mydata[, 21:24] # Covariates # Create total score column calcualting total item score for each patient mydata$total_score <- rowSums(mydata[, 1:20]) # Fit the DIFtree model (Y = response data, X = covariate data) mod <- DIFtree(Y, X, model = "Logistic", type = "udif", alpha = 0.05, nperm = 100, trace = TRUE) # Predict item responses using the model and the total score result <- predict_item_responses(mod, dataset = mydata, total_score = "total_score") } else { message("The 'DIFtree' package is not installed. Please install it to run this example.") }if (requireNamespace("DIFtree", quietly = TRUE)) { # Load DIFtree library(DIFtree) # Load the dataset data("mydata", package = "IFTPredictor") # Observe the data head(mydata) # Extract response and covariate data Y <- mydata[, 1:20] # Item responses X <- mydata[, 21:24] # Covariates # Create total score column calcualting total item score for each patient mydata$total_score <- rowSums(mydata[, 1:20]) # Fit the DIFtree model (Y = response data, X = covariate data) mod <- DIFtree(Y, X, model = "Logistic", type = "udif", alpha = 0.05, nperm = 100, trace = TRUE) # Predict item responses using the model and the total score result <- predict_item_responses(mod, dataset = mydata, total_score = "total_score") } else { message("The 'DIFtree' package is not installed. Please install it to run this example.") }