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;
The cylinders column has two missing values, that would cause your issue.
The cylinders column has two missing values, that would cause your issue.
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.
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.