data.fims.Aus.Jpn.RdDataset FIMS study with raw responses (data.fims.Aus.Jpn.raw) or
scored responses (data.fims.Aus.Jpn.scored) of Australian and
Japanese Students.
data(data.fims.Aus.Jpn.raw) data(data.fims.Aus.Jpn.scored)
A data frame with 6371 observations on the following 16 variables.
SEXGender: 1 -- male, 2 -- female
M1PTI1A Mathematics item
M1PTI2A Mathematics item
M1PTI3A Mathematics item
M1PTI6A Mathematics item
M1PTI7A Mathematics item
M1PTI11A Mathematics item
M1PTI12A Mathematics item
M1PTI14A Mathematics item
M1PTI17A Mathematics item
M1PTI18A Mathematics item
M1PTI19A Mathematics item
M1PTI21A Mathematics item
M1PTI22A Mathematics item
M1PTI23A Mathematics item
countryCountry: 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) }