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/... 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 601 views
  • 2 likes
  • 2 in conversation