Fitting Standard Dichotomous Model via GENLIN - Updated

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fitting Standard Dichotomous Model via GENLIN - Updated

Ryan
Dear SPSS-L,
 
BELOW my name is updated SPSS code to generate data, remove cases with all zero or all one responses, and fit a standard dichotomous Rasch model using the GENLIN procedure. Special thanks to David and Bruce for cleaning up the previous inefficient code!!! I take no credit for the code prior to the GENLIN procedure.
 
By standard dichotomous Rasch model, I am referring to the following logit equation:
 
logit(p_ij) = log[p_ij / (1 - p_ij)] = beta_j - theta_i
 
where
 
beta_j = ability of jth person
theta_i = difficulty of ith item
 
*Some form of this equation can be found in virtually all standard Rasch/IRT textbooks.
 
Best,
 
Ryan
 
p.s. I realize that creating a new thread on the same topic is frowned upon, as it should be. However, given the multiple posts with various pieces of code spread throughout the previous thread, I thought it would be best to start a new thread. Forgive me for breaking a cardinal rule.
 
p.p.s. It is worth noting that I have done a fairly thorough validation of my GENLIN code to fit a standard dichotomous Rasch model by comparing the results to WINSTEPS (specialized Rasch software). Despite the different estimation methods employed by the software packages, the results (parameter estimates, overall fit statistics, etc.) are virutally identical. Still, there is always room for further validation.
 
--
 
SET SEED 873456542.
NEW FILE.
INPUT PROGRAM.
+ DO REPEAT
Diff= #item_difficulty_01 TO #item_difficulty_18
/X=.10 .15 .2 .25 .3 .35 .4 .45 .475 .525 .55 .60 .65 .7 .75 .8 .85 .9 .
+ COMPUTE Diff=LN(X/(1-X)).
+ END REPEAT.
+ LOOP person = 1 to 1000.
+ COMPUTE #person_ability = RV.NORMAL(0,1).
+ VECTOR item_diff=#item_difficulty_01 TO #item_difficulty_18.
+ LOOP item = 1 to 18.
+ COMPUTE #prob = 1 / (1 + EXP(-( #person_ability - item_diff(item)))).
+ COMPUTE response = RV.BERNOULLI(#prob).
LEAVE PERSON.
+ END CASE.
+ END LOOP.
+ END LOOP.
+ END FILE.
END INPUT PROGRAM.
EXECUTE.
AGGREGATE
/OUTFILE=* MODE=ADDVARIABLES
/BREAK=person
/response_SD=SD(response).
 
SELECT IF (response_SD GT 0).
EXECUTE.
 
*Fit Dichotomous Rasch Model.
GENLIN response (REFERENCE=FIRST) BY person item (ORDER=ASCENDING)
/MODEL person item INTERCEPT=NO
DISTRIBUTION=BINOMIAL LINK=LOGIT
/EMMEANS TABLES=person SCALE=TRANSFORMED
/EMMEANS TABLES=item SCALE=TRANSFORMED
/MISSING CLASSMISSING=EXCLUDE
/PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION.