An efficient loop for storing sensitivity/specificity

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator

Posts: 4
Joined: Fri Feb 09, 2018 12:07 pm

An efficient loop for storing sensitivity/specificity

Postby AbnormalDistribution » Sat Jun 30, 2018 1:48 am

I want to create a matrix that stores the sensitivity and specificity of my probit model at all thresholds from .01 to 1.00. So I create a 100x3 matrix and wrote this loop:

Code: Select all

%dep = "my_binary_var"
%eq = "my_equation"

matrix(100,3) my_matrix

for !i = 1 to 100
   !threshold = !i/100
   freeze(iteration_tab) my_equation.predict(!threshold)
   my_matrix(!i,1) = @val(iteration_tab(13,2))
   my_matrix(!i,2) = @val(iteration_tab(13,3))
   my_matrix(!i,3) = !threshold
   d iteration_tab

The thing is it seems a little clunky and unsophisticated because I have to freeze and delete the prediction table each time. Is there a better way I can approach this task?

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 3 guests