BookmarkSubscribeRSS Feed
Rick_SAS
SAS Super FREQ

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

Tom
Super User Tom
Super User

Before of course.  Fix the data using normal coding before venturing off into the world of matrix operations.

Tom
Super User Tom
Super User

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;
cleokatt
Calcite | Level 5
yes, that was the problem that my matrix was nx(n-1)

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 18 replies
  • 1224 views
  • 0 likes
  • 5 in conversation