View source: R/02B_TestStatistics.R
TestStatistics | R Documentation |
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).
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)
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. |
The returned object depends on the data type:
For binary data, a list of class c("exametrika", "TestStatistics") containing:
Length of the test. The number of items included in the test.
Sample size. The number of rows in the dataset.
Average number of correct answers.
Standard error of mean.
Variance of test scores.
Standard Deviation of test scores.
Skewness of score distribution (measure of asymmetry).
Kurtosis of score distribution (measure of tail extremity).
Minimum score.
Maximum score.
Range of scores (Max - Min).
First quartile. Same as the 25th percentile.
Median. Same as the 50th percentile.
Third quartile. Same as the 75th percentile.
Interquartile range. Calculated by subtracting Q1 from Q3.
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.