cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

How to perform matrix operations?

Hello! I am learning multiple linear regression using matrix form. I wondered if there is a way to transform the data into matrix form and perform operations such as transpose, multiplication, and inverse, to find the coefficients. I appreciate your help!

2 REPLIES 2

Re: How to perform matrix operations?

Yes, JMP contains significant support for matrices in the scripting language. I suggest using the online document for matrices in JSL. I also suggest using the Help > Scripting Index > Functions > Matrix to discover or verify syntax.

 

mat.PNG

David_Burnham
Super User (Alumni)

Re: How to perform matrix operations?

Here is some sample code:

 

// generate matrices
X = Column("height") << Get Values;
Y = Column("weight") << Get Values;
// add a column of 1's for the intercept term
X = J(Nrow(X),1) || X; 
// compute least squares estimates
β = Inv(X`*X)*X`*Y;
-Dave