T O P I C R E V I E W |
Slapgravel |
Posted - 11/15/2017 : 05:37:30 AM 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 |
3 L A T E S T R E P L I E S (Newest First) |
YimingChen |
Posted - 11/16/2017 : 10:00:04 AM 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. |
Slapgravel |
Posted - 11/16/2017 : 05:57:12 AM 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. |
YimingChen |
Posted - 11/15/2017 : 5:46:36 PM 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 |
|
|