Programming the statistical procedures from SAS

Proc FCMP: getting missing values with call mult

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 99
Accepted Solution

Proc FCMP: getting missing values with call mult

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;


Accepted Solutions
Solution
‎08-21-2012 12:54 PM
Trusted Advisor
Posts: 1,301

Re: Proc FCMP: getting missing values with call mult

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

View solution in original post


All Replies
Solution
‎08-21-2012 12:54 PM
Trusted Advisor
Posts: 1,301

Re: Proc FCMP: getting missing values with call mult

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

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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