Implements 'PRIDIT' (Principal Component Analysis applied to 'RIDITs'), an
unsupervised, nonparametric method for aggregating ordinal, categorical,
and continuous indicators into a single interpretable composite score.
Originally proposed by Brockett et al. (2002)
An R package that implements the PRIDIT (Principal Component Analysis applied to RIDITs) analysis system as described in Brockett et al. (2002).
install.packages("pridit")
# Install devtools if you haven't already
install.packages("devtools")
# Install the PRIDIT package
devtools::install_github("rlieberthal/PRIDIT")
This package provides three main functions for calculating and analyzing Ridit scores and PRIDIT scores:
ridit() - Calculates Ridit scores for a given dataset using the method developed by Bross (1958) and modified by Brockett et al. (2002)PRIDITweight() - Applies Principal Component Analysis (PCA) to Ridit scores to calculate PRIDIT weights for each variablePRIDITscore() - Calculates final PRIDIT scores using the weights and ridit scoreslibrary(pridit)
# Load your data (first column should be IDs)
data <- data.frame(
ID = c("A", "B", "C", "D", "E"),
var1 = c(0.9, 0.85, 0.89, 1.0, 0.89),
var2 = c(0.99, 0.92, 0.90, 1.0, 0.93),
var3 = c(1.0, 0.99, 0.98, 1.0, 0.99)
)
# Step 1: Calculate ridit scores
ridit_scores <- ridit(data)
# Step 2: Calculate PRIDIT weights
weights <- PRIDITweight(ridit_scores)
# Step 3: Calculate final PRIDIT scores
final_scores <- PRIDITscore(ridit_scores, data$ID, weights)
print(final_scores)
Your input data should be structured as:
The final PRIDIT scores range from -1 to 1, where:
This project is licensed under the Apache License 2.0.
Contributions are welcome! Please feel free to submit a Pull Request.