cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

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