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
 Paste link manipulation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Slapgravel

United Kingdom
9 Posts

Posted - 11/15/2017 :  05:37:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have lots of distribution graphs to make (approx 50) and I'd like to make a template, so I can paste the data to a workbook and it makes the graph automatically.

I'm using a histogram and the lognormal curve from the 'data' tab in plot properties, which outputs to a new sheet in the same book. The issue with this is that the mean and SD appears in the comments of the column in the new sheet and I'd like to display them on the graph along with the total number of data points used. I've made a text box with this text:

----------------------

Total: %(1,@RN)
Mean: %([Book3]"Book3_G Bins",@WL,C[C])
ln sd:

----------------------

Which returns:

----------------------

Total: 113
Mean: ln mean= 8.4836126687284, ln sd=0.5420818835442
ln sd:

----------------------

In a perfect world, I would like the return to read:

----------------------

Total: 113
Mean: 4834.885
ln sd: 0.542

----------------------

Where I can separate the (truncated) mean and SD onto different lines and get the actual value of just the mean by using e^(ln mean). Is this achievable? I'll take splitting the values onto 2 lines at a push and just display ln mean if I can't actually manipulate the value.

Maybe the values output to somewhere else I can grab them from?

Any help would be much appreciated.

Origin Ver. 2015 and Service Release 2:
Operating System: Win 10

YimingChen

1609 Posts

Posted - 11/15/2017 :  5:46:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Presume you have your raw data stored in [Book1]Sheet1!col(B), then you can enter the following into your text box in the graph:

---
Total: $(count(ln(Book1_B)))
Mean: $(mean(ln(Book1_B)),.3)
ln sd: $(stddev(ln(Book1_B)),.3)
---

Thank you,

James

Edited by - YimingChen on 11/15/2017 5:47:32 PM
Go to Top of Page

Slapgravel

United Kingdom
9 Posts

Posted - 11/16/2017 :  05:57:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi James,

Thanks for your reply.

Could you please let me know where "$(mean(ln(Book1_B)),.3)" calculates it's mean from? The lognormal distribution gives different values to the ones that appear when I input your code.

Instead of ln Mean = 8.348 and s = 0.542, I get ln mean = 14.035 and s = 0.512.

Thanks.
Go to Top of Page

YimingChen

1609 Posts

Posted - 11/16/2017 :  10:00:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The script calculates the mean of Col(B) of the first worksheet of "Book1". You can change it to "Book1_B@2" if you are looking for the second worksheet instead.

James.
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