BookmarkSubscribeRSS Feed
Hen07
Calcite | Level 5

Good day 

I have this error and don't know how to fix it. Help would be appreciated.

 

proc iml;
print 'Question 1';
call randseed(123);
alpha=6;
nvec={250};
num_sim=10000;

free keep1;
do i=1 to nrow(nvec);
n=nvec[i,];
do j=1 to num_sim;
u=randfun(n,'uniform',alpha);
x=4/((1-u)**(1/alpha));
T=mean(x)*(1/(mean(x)-4));
keep1=keep1//(n||T);
end;
end;

free keep2;
do k=1 to nrow(keep1) by num_sim;
e_T=mean(keep1[k:k+(num_sim-1),2]);
bias_T=e_T-a;
var_T=var(keep1[k:k+(num_sim-1),2]);
mse_T=var_T-bias_T##2;

keep2=keep2//(e_T||bias_T||var_T||mse_T);
end;

free results;
results=nvec||keep2;
colnames_keep3='n'||'E[T]'||'Var[T]'||'Bias[T]'||'mse[T]';
print results[colname=colnames_keep3];

quit;

 

 

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Show us the log. Include the entire PROC IML portion code and NOTES, WARNINGS and ERRORs. Do not chop anything out of the log from the PROC IML segment.

 

When providing the log, it is critical that you maintain the formatting of the log so we can see it exactly as SAS showed it to you, making it easier for us to use. To maintain the formatting of the log, click on the </> icon and paste the log as text into the window that appears. DO NOT SKIP THIS STEP.

--
Paige Miller
Hen07
Calcite | Level 5
Sorry about that


1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc iml;
NOTE: IML Ready
74
75 print 'Question 1';
76 call randseed(123);
77 aplha=5;
78 nvec={250};
79 num_sim=10000;
80
81 free keep1;
82 do i=1 to nrow(nvec);
83 n=nvec[i,];
84
84 ! do j=1 to num_sim;
85
85 ! u=randfun(n,'uniform',0,1);
86
86 ! x=4/((1-u)**(1/alpha));
87
87 ! mme=(mean(x)/(mean(x)-4));
88
88 ! keep1=keep1//(n||num_sim||mme);
89
89 ! end;
90 end;
NOTE: Module RANDFUN loaded from the storage SASHELP.IMLMLIB.
ERROR: (execution) Matrix has not been set to a value.
operation : / at line 86 column 16
operands : *LIT1013, alpha
*LIT1013 1 row 1 col (numeric)
1
alpha 0 row 0 col (type ?, size 0)
statement : ASSIGN at line 86 column 2
91
92 free keep2;
93 do k=1 to nrow(keep1) by num_sim;
94 e_mme=mean(keep1[k:k+(num_sim-1),3]);
95 bias_mme=e_mme-aplha;
96 var_mme=var(keep1[k:k+(num_sim-1),3]);
97 mse_mme=var_mme-bias_mme##2;
98 keep2=keep2//(e_mme||bias_mme||var_mme||mse_mme);
99 end;
100
101 free results;
102 results=nvec||keep2;
103 colnames_keep3='n'||'E[mme]'||'Bias[mme]'||'var[mme]'||'mse[mme]';
104 print results[colname=colnames_keep3];
105 quit;
NOTE: Exiting IML.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IML used (Total process time):
real time 0.03 seconds
user cpu time 0.03 seconds
system cpu time 0.01 seconds
memory 2067.96k
OS Memory 30884.00k
Timestamp 10/30/2020 02:05:44 PM
Step Count 24 Switch Count 0
Page Faults 0
Page Reclaims 1068
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
106
107
108 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
120

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 567 views
  • 0 likes
  • 2 in conversation