BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AmitKB
Fluorite | Level 6

Hi all,

               I tried to run a ols using proc fcmp. I get a missing SSCP matrix. Hence the program doesnot run.

               I appreicate all the help.

   

Regards,

Amit

code:

data temp;

set sashelp.cars;

keep MPG_City Horsepower Cylinders Weight Length;

run;

proc fcmp;

/* Allocate spaces for matrices */

array input[428, 5] / nosym;

array y[428] / nosym;

array x[428, 4] / nosym;

array xtrans[4, 428] / nosym;

array sscp[4, 4] / nosym;

array sscpinv[4, 4] / nosym;

array beta[4] / nosym;

array xtrans_y[4, 1] / nosym;

/* Input simulation dataset */

rc1 = read_array("temp", input, "MPG_City", "Horsepower", "Cylinders", "Weight", "Length");

rc2 = read_array("temp", y, "MPG_City");

rc3 = read_array("temp", x, "Horsepower", "Cylinders", "Weight", "Length");

/* Calculate OLS regression coefficients */

call transpose(x, xtrans);

call mult(xtrans, x, sscp);

call inv(sscp, sscpinv);

call mult(xtrans, y, xtrans_y);

call mult(sscpinv, xtrans_y, beta);

/* Output resulting matrix as dataset */

rc44 = write_array("sscp1", sscp);

rc46 = write_array("xtrans_y1", xtrans_y);

rc4 = write_array("result", beta);

if rc1 + rc2 + rc3 + rc4 > 0 then put 'ERROR: I/O error';

else put 'NOTE: I/O was successful';

quit;

1 ACCEPTED SOLUTION

Accepted Solutions
FriedEgg
SAS Employee

The cylinders column has two missing values, that would cause your issue.

View solution in original post

1 REPLY 1
FriedEgg
SAS Employee

The cylinders column has two missing values, that would cause your issue.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1528 views
  • 0 likes
  • 2 in conversation