help for difwithpar                                             (Sept 26, 2012)


Detection of and adjustment for differential item functioning (DIF): Identifies differential item functioning, creates dummy/virtual items to be used to adjust ability or trait estimates in PARSCALE, writes the code and data file needed to process the updated item list in PARSCALE, runs PARSCALE, and merges the ability estimates and standard errors into the original data set.

difwithpar varlist , ID(var) RUnname(str) ABility(var) GRoup(var) [NUL(#) NUW(#) NUPValue(#) UBeta(#) UBCH(#) UL(#) ULPValue(#) UW(#) UWPValue(#) MULtinomial(var) minsize(#) SCale(#) CYcles(#) NQpt(#) cleanup(#)]


varlist is the list of variables (items, blocks) to be tested for DIF

id is the subject id variable.

runname is the name of the Parscale run to be generated. code_runname.psl will be the Parscale input file, and data_runname.txt will be the Parscale data file. The results will also go to DfP_runname.log

ability is an ability or trait variable.

group is a binary grouping variable.


multinomial is a multinomial grouping variable.

nul indicates whether the log-likelihood test will be used as a criterion for non-uniform DIF. Default is yes (1). Nul(0) will omit this criterion.

nuw indicates whether the Wald test for the interaction term will be used as a criterion for non-uniform DIF. Default is no (0). Nuw(1) will include this criterion.

nupvalue is the p-value for testing non-uniform DIF. Default is 0.05.

ubeta indicates whether the change in the ability coefficient will be used as a criterion for uniform DIF. Default is yes (1). UBeta(0) will omit this criterion.

ubch is percent change in the ability coefficient for determining uniform DIF. Default is .10. A positive change indicates an increase in the relationship between ability and the outcome with a higher value of the grouping variable.

ul indicates whether the log-likelihood test will be used as a criterion for uniform DIF. Default is no (0). UL(1) will include this criterion.

ulpvalue is the p-value for testing uniform DIF with the log-likelhood method. Default is 0.05.

uw indicates whether the Wald test for the group term will be used as a criterion for uniform DIF. Default is no (0). UW(1) will include this criterion.

uwpvalue is the p-value for testing uniform DIF with the Wald test. Default is 0.05.

minsize is the minimum number of observations/category (default is 20)

scale - changes the scale parameter from the default of 1.7.

nqpt - changes the number of quadrature points from a default of 11.

cycles - changes the maximun number of iterations in PARSCALE stage 2 from the default of 1000.

cleanup(1) deletes the PARSCALE files when the merge is completed.


Sends DIF results to DIFdrunname.log.

Generates an output data set, DIFdetect.dta, which includes individual model results, with Brant test p-values for ordinal items and Hosmer-Lemeshow p-values for binary items. [The relevance of the fit statistics has not been established for DIF.]

Creates dummy/virtual items to be used to adjust ability scores for DIF in PARSCALE. These items will be of the form itemgroupx, where x = 1 represents the lower value of group, and x = 2 the higher. For example, if item item1 had DIF by ethnic, the virtual items will be item1ethnic1 and item1ethnic2. You can merge these virtual items into your data set using mergevirtual.

Displays warning messages when models do not converge, collinearity problems are observed, models are completely determined, standard errors are large, Brant tests are not possible, or items have > 15 levels (PARSCALE will reject).

Collapses categories on variables for which the number of observations is below a specified threshold (default is minszie(20)). If you do not want any categories combined, specify minsize(1).

Drops any variable that does not have enough observations for at least 2 categories, and displays a warning message.

Automatically makes letter codes for item values 10-15.

Allows missing values.

Allows character or numeric ID's up to 9 digits.

Creates a numeric, 12-digit ID code for Parscale by adding 1,000,000,000 to the ID, first converting string IDs to a unique number if needed.

Please make sure that Stata's current working directory is the same as your data's directory (help cd).

Default Parscale instructions are:



If you want to change anything but the scale and cycles, you can edit the .PSL file or this program before running it.

Maximum number of items is 230.

If you will be adjusting for DIF on multiple categories (groups), subdividing can lead to dummy/virtual item names longer than the 31 character limit. Our tip is to generate a new grouping variable with a really short name. For example, .gen g=gender

Otherwise you may get an error message about a variable already being defined or being too long, and end up having to rename long variables within Stata.

Written for Stata 8.2.


difwithpar item1-item13, id(id) ru(gender0) ab(theta0) gr(g)

difwithpar apple - item11, id(id) ru(ethnic0) ab(itemtot) gr(eth) nupv(0.01) ul(1) ulpv(.01) itemsub(1) minsize(35) cleanup(1)


Paul Crane, Laura Gibbons, Lance Jolley, and Gerald van Belle. University of Washington, Copyright 2005. Email: gibbonsl@u.washington.edu

We appreciate the assistance of Tom Koepsell and Rich Jones.

Also see

difd, runparscale, prepar, and mergevirtual.

The PARSCALE website is http://www.ssicentral.com