Thanks! I modified the code but it still gives me this error. I am trying to create a function where I can input any dataset and if I call the function it would still give the output. I am confused as to what is wrong with my code. proc iml; INPUT: dsName = {dataset}; xNames = {'x1' 'x2' 'x3'}; yName ={'y'}; start mlr(dsname,xNames,yName); use (dsName); read all var xNames into x; read all var yName into y; close; n = nrow(x); /* number of observations */ m= ncol(x); /* number of variables */ x=j(n,1,1)||x; /* adding a column of 1 corresponding to intercept*/ /* Compute Xinv, the inverse of X’X and the vector of coefficient estimates Beta. */ xinv=inv(x`*x); beta= xinv*x`*y; finish mlr; run mlr("sashelp.class", {"Height" "Age"}, "Weight"); quit;
... View more