Cronbach's Alpha is one of the most widely used measures of reliability in psychometric assessment and research. This implementation provides a robust and efficient way to calculate the coefficient using Rust's performance capabilities.
- Fast and efficient Cronbach's Alpha calculation
- Support for multiple data formats
- Handles missing values
- Statistical validation checks
- Clear error handling and reporting
Add this to your Cargo.toml:
[dependencies]
cronbach-alpha = "0.1.0"use cronbach_alpha::calculate_alpha;
fn main() {
// Example data matrix (items x participants)
let data = vec![
vec![5, 4, 3, 2],
vec![4, 3, 2, 1],
vec![5, 4, 3, 2],
];
match calculate_alpha(&data) {
Ok(alpha) => println!("Cronbach's Alpha: {:.3}", alpha),
Err(e) => eprintln!("Error: {}", e),
}
}Cronbach's Alpha (α) is calculated using the formula:
α = (k / (k-1)) * (1 - Σσᵢ² / σₜ²)
Where:
- k is the number of items
- σᵢ² is the variance of each item
- σₜ² is the variance of the total score
- Rust 1.56.0 or higher
- Standard statistical libraries
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
-
Cronbach, L. J. (1951). Coefficient alpha and the internal structure of tests. Psychometrika, 16(3), 297-334.
-
Guidelines for reporting reliability and internal consistency statistics in psychological research
Jack J. Burleson
- The Rust community
- Contributors to psychometric research