Learn R Programming

pwrRasch (version 0.1-2)

reshape.rasch: Reshape data frame in wide format into a long format

Description

This function reshapes a matrix from 'wide' into a 'long' format. This is necessary for the three-way analysis of variance with mixed classification for testing the Rasch model.

Usage

reshape.rasch(data, group)

Arguments

data
Matrix or data frame in 'wide' format.
group
Vector which assigns each person to a certain subgroup (external split criterion). Note, that this function is restricted to A = 2 subgroups.

Value

Returns a data frame with following entries:
group
fixed factor A (subgroup)
person
random factor B (testees)
item
fixed factor C (items)
response
dependent variable, 0 (item not solved) and 1 (item solved)

Details

In order to apply the three-way analysis of variance with mixed classification for testing the Rasch model, data need to be in 'long' format. That is, Rasch model data design is interpreted as a analysis of variance design (A > B) x C, where items are levels of a fixed factor C and the testees are levels of a random factor B, nested within a fixed factor A of different subgroups.

References

Kubinger, K. D., Rasch, D., & Yanagida, T. (2009). On designing data-sampling for Rasch model calibrating an achievement test. Psychology Science Quarterly, 51, 370-384.

Kubinger, K. D., Rasch, D., & Yanagida, T. (2011). A new approach for testing the Rasch model. Educational Research and Evaluation, 17, 321-333.

See Also

aov.rasch

Examples

Run this code
## Not run: 
# 
# # simulate Rasch model based data
# # 100 persons, 20 items,
# dat <- simul.rasch(100, items = seq(-3, 3, length.out = 20))
# # reshape simulated data into 'long' format with balanced assignment
# # of testees into two subgroups.
# dat.long <- reshape.rasch(dat, group = rep(0:1, each = nrow(dat) / 2))
# head(dat.long)
# 
# # extract variable names of items
# vnames <- grep("it", names(aid_st2), value = TRUE)
# # reshape aid subtest 2 data into 'long' format with split criterium sex
# aid_long.sex <- reshape.rasch(aid_st2[, vnames], group = aid_st2[, "sex"])
# ## End(Not run)

Run the code above in your browser using DataLab