BookmarkSubscribeRSS Feed
CarsonGrey
Calcite | Level 5

I have a test contains 150 items, item difficulty parameter for each item is as attached. Suppose I now have candidate whose ability level is 0, I named it theta=0. Now on each of the item, I need to calculate the probability of this candidate correctly answer on each of the time, how should I edit the following macro sas code to make it work?

 

 

proc import datafile="\bpar.csv"   dbms=csv out=bpar replace; run;

 

%macro f1;

do i=1 to 150;  /*from item 1 to item 150*/

prob &i= exp(theta-bpar&i)/(1+exp(theta-bpar&i);   /*1 parameter logistic regression model*/

end;

%mend;

%f1;

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello @CarsonGrey and welcome to the SAS Support Communities!

 

Please see @Reeza's reply to @superbug's identical question, posted three days ago: https://communities.sas.com/t5/SAS-Programming/how-to-write-code-for-1-parameter-logistic-model/m-p/... 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 658 views
  • 2 likes
  • 2 in conversation