testRetestAlpha: testRetestAlpha

Description Usage Arguments Details Value Author(s) References Examples

View source: R/testRetestAlpha.R

Description

The testRetestAlpha function computes the test-retest alpha coefficient (Green, 2003).

Usage

1
2
3
testRetestAlpha(dat = NULL, moments = NULL,
                testDat = NULL, retestDat = NULL,
                sortItems = FALSE, convertToNumeric = TRUE)

Arguments

dat

A dataframe containing 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 items have to be ordered chronologically (i.e. first all items for the first measurement, then all items for the second measurement), or the vector 'moments' has to be used to indicate, for each item, to which measurement moment it belongs.

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).

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.

Details

This function computes the test-retest alpha coefficient as described in Green (2003).

Value

An object with the input and several output variables. Most notably:

input

Input specified when calling the function

intermediate

Intermediate values and objects computed to get to the final results

output$testRetestAlpha

The value of the test-retest alpha coefficient.

Author(s)

Gjalt-Jorn Peters

Maintainer: Gjalt-Jorn Peters <gjalt-jorn@userfriendlyscience.com>

References

Green, S. N. (2003). A Coefficient Alpha for Test-Retest Data. Psychological Methods, 8(1), 88-101. doi:10.1037/1082-989X.8.1.88

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
### This will prompt the user to select an SPSS file
testRetestAlpha();

## End(Not run)

### 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
testRetestAlpha(exampleData);

userfriendlyscience documentation built on May 2, 2019, 1:09 p.m.