TestStatistics {exametrika} | R Documentation |
Simple Test Statistics
Description
Calculates descriptive statistics for test scores, providing a comprehensive summary of central tendency, variability, and distribution shape. Different statistics are calculated based on the data type (binary, ordinal, rated, or nominal).
Usage
TestStatistics(U, na = NULL, Z = NULL, w = NULL)
## Default S3 method:
TestStatistics(U, na = NULL, Z = NULL, w = NULL)
## S3 method for class 'binary'
TestStatistics(U, na = NULL, Z = NULL, w = NULL)
## S3 method for class 'ordinal'
TestStatistics(U, na = NULL, Z = NULL, w = NULL)
Arguments
U |
Either an object of class "exametrika" or raw data. When raw data is given,
it is converted to the exametrika class with the |
na |
Values to be treated as missing values. |
Z |
Missing indicator matrix of type matrix or data.frame. Values of 1 indicate observed responses, while 0 indicates missing data. |
w |
Item weight vector specifying the relative importance of each item. |
Value
The returned object depends on the data type:
For binary data, a list of class c("exametrika", "TestStatistics") containing:
- TestLength
Length of the test. The number of items included in the test.
- SampleSize
Sample size. The number of rows in the dataset.
- Mean
Average number of correct answers.
- SEofMean
Standard error of mean.
- Variance
Variance of test scores.
- SD
Standard Deviation of test scores.
- Skewness
Skewness of score distribution (measure of asymmetry).
- Kurtosis
Kurtosis of score distribution (measure of tail extremity).
- Min
Minimum score.
- Max
Maximum score.
- Range
Range of scores (Max - Min).
- Q1
First quartile. Same as the 25th percentile.
- Median
Median. Same as the 50th percentile.
- Q3
Third quartile. Same as the 75th percentile.
- IQR
Interquartile range. Calculated by subtracting Q1 from Q3.
- Stanine
Stanine score boundaries, see
stanine
.
For ordinal and rated data, the function calls ScoreReport
and returns
its result. See ScoreReport
for details of the returned object.
For nominal data, an error is returned as this function does not support nominal data.
Examples
# Basic usage
stats <- TestStatistics(J15S500)
print(stats)
# Extract specific statistics
cat("Mean score:", stats$Mean, "\n")
cat("Standard deviation:", stats$SD, "\n")
# View score distribution summary
summary_stats <- data.frame(
Min = stats$Min,
Q1 = stats$Q1,
Median = stats$Median,
Mean = stats$Mean,
Q3 = stats$Q3,
Max = stats$Max
)
print(summary_stats)