Running Winsteps With SAS
Running Winsteps With SAS
edu/users/ueka
Summary
Winsteps is a Rasch Model Analysis Software written by John M. Linacre
(www.winsteps.com). It is a user-friendly program, but like other stand-alone programs, it
requires many files. Before I “invented” the method that I introduce here, I needed to
remember names and locations of so many files, including the files that prepared the data,
the different versions of control files, different versions of result outputs, and different
versions of batch mode execution files. When I was going insane, I came up with this idea
of gathering all the necessary programming in one central location, i.e., a SAS program file.
In Appendix, I also attached my experimental SAS program that runs Bryk,
Raudenbush, & Congdon’s HLM® program. It uses a sample data that accompanies the
HLM software, so it is ready to run.
1
I acknowledge that Professor Charles Bidwell’s limitless sociological imagination forced me to
www.src.uchicago.edu/users/ueka
run;
The data set used for this exercise can be found with this
document at www.src.uchicago.edu. It is read at the
beginning of this program. Because I found that item
difficulty of some items vary by gender, I am treating these
variables as separate items for female students. In this
application, “If sex=2 then do” means do the following
programming only for women.
www.src.uchicago.edu/users/ueka
c) Use the SAS data set just read and write out a
WINSTEP®-ready simple-text data set.
%varnames ;
When the content inside the parentheses contain &, use single
quotes instead of double quotes, so SAS will recognize it as
a part of text rather than as a SAS-specific functional term.
www.src.uchicago.edu/users/ueka
/*This run uses only boys’ data. See how I used pselect
option*/
x "start &win &WD&scale..con &WD&scale._boys.out
pselect=??????1* ifile=&WD&scale._boys.ifile";
/*This run uses only girls’ data. See how I used pselect
option*/
x "start &win &WD&scale..con &WD&scale._girls.out
pselect=??????2* ifile=&WD&scale._girls.ifile";
f) Read in item measure files (*.if) and create SAS data set.
proc sort;
by name;
run;
%edward (suji=whole);
%edward (suji=boys);
%edward (suji=girls);
/*graphing*/
goptions gsfname=outfiles dev=gif gunit=pct cback=white
htitle=6 htext=3 ftext=swissb ctext=black vsize=8 hsize=8;
title1 font=duplex "Item difficulty varying by subsamples";
footnote1 "";
symbol interpol=spline /*join*/ value=dot height=1;
proc gplot data=here.&scale._idif;
plot measure*subgroup=name / /*overlay*/;
run;
quit;
www.src.uchicago.edu/users/ueka
run;
www.src.uchicago.edu/users/ueka
www.src.uchicago.edu/users/ueka
APPENDIX
Running Bryk, Randenbush, & Congdon’s HLM from within SAS
I wrote this program a while ago. It works, but I don’t really use this because I have never
succeeded in creating SSM file with my own data. This particular program uses a sample
data that accompanies HLM program, so as long as you installed SAS in a default place,
anyone can copy and paste this into SAS and run it. The programming here is relatively
simple. The basic idea is the same as my WINSTEP-SAS program. It writes out a control
file and runs it with HLM. Then it reads in the output file and applies some analyses.
data hlm;
input line $ 1-75;
cards;
#This command file was run with
C:\HLM5\Examples\AppendxA\HSB.SSM
NUMIT:10000
STOPVAL:0.0000010000
NONLIN:n
LEVEL1:MATHACH=INTRCPT1+SES,1+RANDOM
LEVEL2:INTRCPT1=INTRCPT2+SECTOR+MEANSES+RANDOM/
LEVEL2:SES=INTRCPT2+SECTOR+MEANSES+RANDOM/
RESFIL:Y/
RESFILTYPE:SAS
RESFILNAME:C:\HLM5\Examples\AppendxA\HSB1.sas
HETEROL1VAR:n
PRINTVARIANCE-COVARIANCE:Y
www.src.uchicago.edu/users/ueka
ACCEL:5
LVR:N
LEV1OLS:10
HYPOTH:n
FIXTAU:3
CONSTRAIN:N
OUTPUT:C:\HLM5\Examples\AppendxA\hsb1.out
TITLE:INTERCEPT AND SLOPES-AS-OUTCOMES MODEL
;
%include "C:\HLM5\Examples\AppendxA\HSB1.sas" ;
run;
www.src.uchicago.edu/users/ueka