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中文论坛
 Origin 中文论坛 (Chinese Origin Forum)
 请教关于origin数据统计处理的问题
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

彩色的云

17 Posts

Posted - 06/28/2016 :  09:59:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:我现在有如图所示的一组数据,想分别计算不同数据范围内数值加和对所有数值总和的贡献百分数,并画频率分布图。比如我在0-30之间每间隔5分一个数据档,然后分别计算0-5,5-10,10-15等范围内的数据的加和除以所有数据的和,得到几个百分数,然后对他们进行画图,要怎么实现,主要是数据统计处理那部分不知道怎么弄,麻烦帮忙,谢谢!

yuki_wu

896 Posts

Posted - 06/29/2016 :  03:26:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
你可以有如下两种方法对数据分组求和。

第一种方法:
假设你有原始数据于col(A),则可:

1.在col(B)并输入你需要分组的区间值,如0,5,10,15...
2.新增col(C),选择col(C)并右键选择Set Column Values...
3.在Set Values的对话框中输入:Index(Col(A),Col(B),1)
关于function Index的详细用法可以参考
http://www.originlab.com/doc/LabTalk/ref/Index-func

4.选择col(A),在菜单栏选择Statistics: Descriptive Statistics: Statistics on Columns
5.在Statistics on Columns对话框中,在Group中添加col(C)

6.点击OK后,在Worksheet DescStatsQuantities1中就可以看到各区间的和

7.将各区间的和值除于总和即可。
注:计算总和值可重复第4步和第5步,但不要设置Group


第二种方法:
假设col(A)中有[0,20]以内原始数据,分组为(0.5],(5.10],(10.15],(15.20]

1.新增col(C),打开Command Window并运行以下scripts:

range nn=[Book1]1!2;
for(ii=1; ii<=4; ii++)  
{
double aa;
double bb=(ii-1)*5; //计算区间值
aa=sumif(col(A),"col(A) > bb && col(A) <= (bb+5)"); //计算各区间和值
nn[ii]=aa;
};

stats ix:=col(1) sum:=mysum; //计算总和值
range rr=[Book1]1!3;
rr=nn/mysum; //计算百分比


有关sumif的详细用法可参考:
http://www.originlab.com/doc/LabTalk/ref/Sumif-func

Yuki

Edited by - yuki_wu on 06/29/2016 03:27:16 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