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 for Programming
 LabTalk Forum
 behavior of average command
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ibvmt

Switzerland
Posts

Posted - 12/09/2004 :  06:23:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: win XP pro

Hi
I have data columns that are only partially filled (gaps of some empty lines). The problem now is, that the ave command creates more data than was originally present.
If I create a new worksheet (all cells are empty), enter some data and use the ave command, I get as many data points as I entered before.
If I have a column filled with values and delete them, then the cells are filled with dashes. Using the ave command on data cells surrounded by cells with dashes creates more data points. How could this be prevented?
Thanks
Peter

greg

USA
1380 Posts

Posted - 12/16/2004 :  12:16:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You do not mention which options you are using, but you are seeing normal behavior.
With no option, as in :
average data1_b
a cell will be replaced by the average of itself and each neighbor - normally three values except at the 'ends'.
If a particular cell has missing values the process is still the same except the value of the cell and its count is not considered.

So 3 followed by missing followed by 9 will result in the missing value being replaced by 6 ( ( 3 + 9 ) / 2 = 6 ).

The average command is destructive in that it replaces the dataset operated on. If you worked with a copy, you could restore those missing values with this script :

col(2) = col(1)==0/0?0/0:col(2);

where column 1 is the original data and column 2 holds the values as averaged.


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