data.fims.Aus.Jpn.Rd
Dataset FIMS study with raw responses (data.fims.Aus.Jpn.raw
) or
scored responses (data.fims.Aus.Jpn.scored
) of Australian and
Japanese Students.
A data frame with 6371 observations on the following 16 variables.
SEX
Gender: 1 -- male, 2 -- female
M1PTI1
A Mathematics item
M1PTI2
A Mathematics item
M1PTI3
A Mathematics item
M1PTI6
A Mathematics item
M1PTI7
A Mathematics item
M1PTI11
A Mathematics item
M1PTI12
A Mathematics item
M1PTI14
A Mathematics item
M1PTI17
A Mathematics item
M1PTI18
A Mathematics item
M1PTI19
A Mathematics item
M1PTI21
A Mathematics item
M1PTI22
A Mathematics item
M1PTI23
A Mathematics item
country
Country: 1 -- Australia, 2 -- Japan
if (FALSE) {
data(data.fims.Aus.Jpn.scored)
#*****
# Model 1: Differential Item Functioning Gender for Australian students
# extract Australian students
scored <- data.fims.Aus.Jpn.scored[ data.fims.Aus.Jpn.scored$country==1, ]
# select items
items <- grep("M1", colnames(data.fims.Aus.Jpn.scored), value=TRUE)
## > items
## [1] "M1PTI1" "M1PTI2" "M1PTI3" "M1PTI6" "M1PTI7" "M1PTI11" "M1PTI12"
## [8] "M1PTI14" "M1PTI17" "M1PTI18" "M1PTI19" "M1PTI21" "M1PTI22" "M1PTI23"
# Run partial credit model
mod1 <- TAM::tam.mml(scored[,items])
# extract values of the gender variable into a variable called "gender".
gender <- scored[,"SEX"]
# computes the test score for each student by calculating the row sum
# of each student's scored responses.
raw_score <- rowSums(scored[,items] )
# compute the mean test score for each gender group: 1=male, and 2=female
stats::aggregate(raw_score,by=list(gender),FUN=mean)
# The mean test score is 6.12 for group 1 (males) and 6.27 for group 2 (females).
# That is, the two groups performed similarly, with girls having a slightly
# higher mean test score. The step of computing raw test scores is not necessary
# for the IRT analyses. But it's always a good practice to explore the data
# a little before delving into more complex analyses.
# Facets analysis
# To conduct a DIF analysis, we set up the variable "gender" as a facet and
# re-run the IRT analysis.
formulaA <- ~item+gender+item*gender # define facets analysis
facets <- as.data.frame(gender) # data frame with student covariates
# facets model for studying differential item functioning
mod2 <- TAM::tam.mml.mfr( resp=scored[,items], facets=facets, formulaA=formulaA )
summary(mod2)
}