cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

Recommended Articles