The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Input cell variable in Linear fit dialog
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

sreekarorigin

India
2 Posts

Posted - 02/17/2021 :  2:13:40 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2021 (64-bit)
9.8.0.200 (Learning Edition)

Operating System: Windows 10 64 bit

Dear all,
For a linear fit analysis, I need to input a cell value from a worksheet as a fixed intercept value in the "Fit Control" tab of "Linear Fit" dialog. I need to check how the linear fit changes by manually varying the intercept value from the worksheet. Please suggest how to do this, if it is possible to do so.

sincerely yours,

Sreekar Guddeti
Graduate Student
Indian Institute of Science Bangalore

Edited by - sreekarorigin on 02/17/2021 2:15:11 PM

YimingChen

1593 Posts

Posted - 02/17/2021 :  3:09:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can probably use Set Column Value(SCV) feature in Origin. See the picture below, put the intercept value in C1, open SCV dialog of col(D), put the script in.

range r1 = col(C);
fitLR iy:=(1,2) fixint:=1 intercept:=r1[1] oy:=col(D);

Then you can change the intercept value and the fitting result gets updated.


James
Go to Top of Page

sreekarorigin

India
2 Posts

Posted - 02/18/2021 :  08:08:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear James,
Thanks for the solution. It worked . In addition to the access to linear fit function from Set Column Values dialog, I need the function that calculates the residual sum of squares (RSS). Currently I am creating new column C to calculate the RSS using

sum((rData - rLF)^2)

I tried finding an appropriate function in the "Search and Insert Functions" dialog but was not successful. Could you suggest how to directly get RSS through LT script, if it is possible?



sincerely yours,


Sreekar Guddeti
Graduate Student
Indian Institute of Science Bangalore
Go to Top of Page

YimingChen

1593 Posts

Posted - 02/18/2021 :  08:54:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can add two lines of code to put R value in a User Defined column label row.

wks.userparam(++Rvalue); 
col(D)[D1]$ = $(fitLR.r);


Please also refer to the fitLR Xfunction:
https://www.originlab.com/doc/X-Function/ref/fitLR

James

Edited by - YimingChen on 02/18/2021 09:05:18 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000