Learn R Programming

userfriendlyscience (version 0.1-2)

testRetestReliability: testRetestReliability

Description

The testRetestReliability function is a convenient interface to testRetestAlpha and testRetestCES.

Usage

testRetestReliability(dat = NULL, moments = NULL,
                      testDat = NULL, retestDat = NULL,
                      parallelTests = 'means',
                      sortItems = FALSE, convertToNumeric = TRUE,
                      digits=2)

Arguments

dat
A dataframe. This dataframe must contain the items in the scale at both measurement moments. If no dataframe is specified, a dialogue will be launched to allow the user to select an SPSS datafile. If only one dataframe is specified, either the
moments
Used to indicate to which measurement moment each item in 'dat' belongs; should be a vector with the same length as dat has columns, and with two possible values (e.g. 1 and 2).
testDat, retestDat
Dataframes with the items for each measurement moment: note that the items have to be in the same order (unless sortItems is TRUE).
parallelTests
A vector indicating which items belong to which parallel test; like the moments vector, this should have two possible values (e.g. 1 and 2). Alternatively, it can be character value with 'means' or 'variances'; in this case, parallelSubscales wil
sortItems
If true, the columns (items) in each dataframe are ordered alphabetically before starting. This can be convenient to ensure that the order of the items at each measurement moment is the same.
convertToNumeric
When TRUE, the function will attempt to convert all vectors in the dataframes to numeric.
digits
Number of digits to show when printing the output

Value

  • An object with the input and several output variables. Most notably:
  • inputInput specified when calling the function
  • intermediateIntermediate values and objects computed to get to the final results
  • output$testRetestAlphaThe value of the test-retest alpha coefficient.
  • output$testRetestCESThe value of the test-retest Coefficient of Equivalence and Stability.

Details

This function calls both testRetestAlpha and testRetestCES to compute and print measures of the test-retest reliability.

Examples

Run this code
### This will prompt the user to select an SPSS file
testRetestReliability();

### Load data from simulated dataset testRetestSimData (which
### satisfies essential tau-equivalence).
data(testRetestSimData);

### The first column is the true score, so it's excluded in this example.
exampleData <- testRetestSimData[, 2:ncol(testRetestSimData)];

### Compute test-retest alpha coefficient
testRetestReliability(exampleData);

Run the code above in your browser using DataLab