> do I have to have it?
I included that information so that you can easily check the names of the variables in the input matrix. But you can ignore that suggestion if you prefer an alternative.
Before of course. Fix the data using normal coding before venturing off into the world of matrix operations.
Fix it before you get into IML.
You have 7 observations and only 6 analysis variables. If you want to make sure there are 7 analysis variables then just make a new variable that is all missing.
In your case you seem to be naming the variable MK1 to MK7 but you didn't create the MK1 variable.
So you can just run this code.
data square;
length scale $8 mk1-mk7 8 ;
set psuedo_data;
run;
If you don't know which how many MK variables there should be just first count the number of observations and put it into a macro variable.
proc sql noprint;
select count(*) into :nobs trimmed from psuedo_data;
quit;
data square;
length scale $8 mk1-mk&nobs 8;
set psuedo_data;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.