BookmarkSubscribeRSS Feed
demian
Calcite | Level 5

Hi,

I am new in SAS.

While I am doing Preacher & Hayes's sobel macro using SAS, I got error message. Please see below:

statement : IF at line 182 column 1

ERROR: Matrix bw has not been set to a value.

statement : PRINT at line 182 column 1

ERROR: Matrix op has not been set to a value.

statement : PRINT at line 182 column 1

ERROR: Matrix r2med has not been set to a value.

I executed the command set called called %sobel, with syntax:

%sobel(data=file, y dv, x=iv, m med, boot=z);


I added this syntax at the end of matrix provided by Precher's & Hayes...


For example,

.

.

.

%mend sobel;

%sobel  (data=2011.sav, y=BDI, x=WORRY, m=DAILYCOMPGAME, boot=5000);

Any idea?

4 REPLIES 4
Rick_SAS
SAS Super FREQ

Can you post a small sample data set that we can run?

Rick_SAS
SAS Super FREQ

Use these data to check your syntax. It runs without error for me on SAS 9.3:


data A;
call streaminit(1);
do i = 1 to 12;
   y = ceil(5*rand("uniform"));
   x = ceil(5*rand("uniform"));
   m = ceil(5*rand("uniform"));
   output;
end;
run;

%sobel(data=work.A, y=y, x=x, m=m, boot=20)

demian
Calcite | Level 5

Thank you very much! Sort it out!

Rick_SAS
SAS Super FREQ

And welcome to SAS, by the way. These SAS Communities are a great resource, so I'm glad you've discovered them.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 4 replies
  • 1112 views
  • 3 likes
  • 2 in conversation