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
 Entering and Plotting Categorical Data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Firat

3 Posts

Posted - 06/01/2014 :  08:27:35 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I just recently started using Origin and I ran into several problems especially when trying to deal with categorical data.
First off, let me try to lay the foundations and describe the setup of my data:

I am looking at two groups of cells (wild type and knockout), which I'll call Group A and Group B.
Both of these groups are treated with different compounds (Untreated and Treatment A through C).
I then perform microscopy on these cells and count certain structures. I do this four times for every treatment (in different fields of views), constituting one replicate.
Additionally, I repeat the experiments several times, each time counting four fields of view. This constitutes one experiment.

What I want to have in the end is a grouped bar plot, the groups being wild type and knockout, with four categorical ticks (Untreated and Treatments). In this plot, I want to show the means across all experiments.

To achieve this goal, I came up with a relatively awkward workflow:

I enter data in 4 columns.
Group (X1): Group A or Group B
Experiment (X2): the count of the current experiment (1, 2, 3). Basically "current n".
Treatment (X3, Text): Untreated, Treatment A, Treatment B, Treatment C
Because I count multiple fields, there is more than one Untreated, Treatment A, ... for each experiment!
Count (Y1): Readout.

To get my data ready to plot, I then proceed to perform statistics on Column "Count", with a Grouping Range of "Group", "Experiment" and "Treatment".
After this, I get the means for the different replicates (fields of view) per experiment.

On the output of this statistical analysis, I perform another statistics on Column "Mean", this time with a Grouping Range of "Group" and "Treatment", but not "Experiment". This averages all the replicates for one experiment.


Problem 1: Workflow for Descriptive Statistics
The reason I am doing this in two steps and don't just take the average of everything at once is the Standard Error of the Mean, which would be changed by doing it all at once. The different fields of view constitue only one observation and should therefore not be taken into account for the SEM.
I am very happy for suggestions of easier methods of achieving this goal!

I plot the data using regular Column plots. I am not using Grouped Columns because (to my knowledge) they do not allow me to change the display order of groups. I always want the wild type to appear to the left, knockout to the right. I select all of my data belonging to one group, create a column plot, then select the other group and drag'n'drop it onto the existing graph. In this way, I can group and order the data via the "Layer Contents" menu.
However, I don't see a way to reorder the X axis. I use a script to perform the counting on my images which outputs the results by treatment depending on the order of files in the folder, therefore I cannot sort my treatments like I want them from the beginning. Reordering them by hand is also extremely awkward.
As a workaround, I create an additional dummy column "Treatment No" and use LabTalk to check the value of the "Treatment" column and to fill "Treatment No" accordingly with numbers from 1-4, depending on the order I want. Then, I sort the worksheet by "Group" and by "Treatment No" and get the data ordered the way I want it.
Problem 2: Because I plot from output of "Statistics on Columns", there are recalculate operations active which prevent me from reordering the columns unless I set recalculate to none. This is a minor concern, but is it possible to reorder to worksheet and keep the recursiveness intact?


The X axis is then labelled by using Tick-indexed dataset.
This works, but it's not very intuitive.
Problem 3: Plotting the Data
Is there an easier way to reorder both the groups and the X axis?


Finally, I would be interested to hear how you enter replicates and independent experiments in a sensible way. I feel like creating a new worksheet per experiment and handling replicates within one would be okay, but that results in an incredible chaos of statistics output and just a very large amount of worksheets.

Also, I might have found a bug, but maybe I'm just doing something wrong. I am very happy to attach a file with everything filled in where the bug can be reproduced, but I can't seem to found that function right now.

Possible Bug report: Values not appearing in bar plot.
1) Open a new workbook with 3 columns., call Column A "Experiment", Set as X. Call Column B "Treatment", Set as X and Categorical. Call Column C "Result", set as Y.
2) In A1 to A8, enter 1. In A9 to A 16, enter 2.
3) In B1 to B4, B5 to B8, in B9 to B12 and in B13 to B18, enter Treatment A to Treatment D.
4) Fill C1 to C16 with numbers.
5) Perform statistics on Column "Result", Grouping Range "Experiment" and "Treatment".
6). On the "Flat"-output, select Treatment A to Treatment D of only Experiment 1. Select associated Mean and Standard Deviation values and create a Column plot from this selection.
7) Select Treatment A to Treatment D of only Experiment 2. Select associated Mean and Standard Deviation values and drag and drop this selection on the existing graph.
8) Double click the X axis of the graph and set under Tick Labels/Bottom, set Type to Categorical.
9) Select Layer contents and group the two means together.

Expected result: The data you dragged onto the graph second will not be drawn.


Thank you so much for reading this wall of text, it became a little longer than expected. Any input is greatly appreciated!


Origin Ver. and Service Release: Origin Pro 9.1.0 (64 bit) Sr2
Operating System: Windows 7 64 bit

lkb0221

China
497 Posts

Posted - 06/02/2014 :  10:08:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Would you mind sending your data to us so we can play with it? With your serial number, of course.
It's hard to reproduce some of the problems you've reported.

Zheng
OriginLab

Edited by - lkb0221 on 06/02/2014 10:40:35 AM
Go to Top of Page

snowli

USA
1379 Posts

Posted - 06/02/2014 :  10:27:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Firat,

As Zheng said, we'd like to work with you to see how to improve this area if there are issues. And sending data will help us look into the issues.

BTW, there is Sort Group checkbox in Grouped Plot dialog so you can uncheck it to keep your original order.

E.g. in the Flat output of Statistics, you can highlight Mean and SD columns and choose Plot: Column/Bar/Pie: Grouped Columns - Indexed Data

In the dialog, select Group and Treatment as Group.
And uncheck Sort Group checkbox to plot it.
--> The bars will follow your original order.

Also double click the plot to open Plot Details db. You can easily modify the Fill Color to be Indexed to Group or Treatment so same group/treatment has the same color.

Thanks, Snow
OriginLab Corp.
Go to Top of Page

Firat

3 Posts

Posted - 06/02/2014 :  2:29:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli
BTW, there is Sort Group checkbox in Grouped Plot dialog so you can uncheck it to keep your original order.

E.g. in the Flat output of Statistics, you can highlight Mean and SD columns and choose Plot: Column/Bar/Pie: Grouped Columns - Indexed Data

In the dialog, select Group and Treatment as Group.
And uncheck Sort Group checkbox to plot it.
--> The bars will follow your original order.

Also double click the plot to open Plot Details db. You can easily modify the Fill Color to be Indexed to Group or Treatment so same group/treatment has the same color.

Thanks, Snow
OriginLab Corp.



Yes, I know that function. However, that doesn't help if the data is not already entered in the correct order. Sometimes, the order I want to show my data in does not correspond to alphabetical order either, which necessitates that little workaround of assigning numbers to everything.

I'd also be happy to provide you with my file. Where should I send it?
Go to Top of Page

lkb0221

China
497 Posts

Posted - 06/02/2014 :  2:35:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can send the files to <tech@originlab.com>.

Zheng
OriginLab
Go to Top of Page

snowli

USA
1379 Posts

Posted - 07/30/2014 :  10:55:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Firat,

We are working on Origin 9.2 now and have implemented it in Origin 9.2 beta.

We tried to send an email to you but the email was rejected. Could you let us know if you would like to try 9.2 and how to send the instruction and download link to you?

It will allow you to customize categorical value orders and grouped bar plot will follow the categorical value orders you set so what you wanted to do will be very easy to do in 9.2.

Sincerely, Snow Li
OriginLab Corp.
Go to Top of Page

Firat

3 Posts

Posted - 07/30/2014 :  12:06:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi again,

I did get the E-Mail with the download link and activation instructions and will be doing some tests. I don't know why you received a rejection mail, though.
Go to Top of Page

snowli

USA
1379 Posts

Posted - 07/30/2014 :  12:27:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Oh, it's great to know.

Sorry that maybe I mixed you up with another Germany user whose email is rejected. Great to know you will test.

We removed the sorting controls in Group Column Plot dialog. Instead, you can set the group columns to be categorical and set the categories order before plotting. Then the grouped plot will follow the categorical order you set.

If you don't set the grouped columns as categorical in advance, it will use alphabetic ascending order.

Thank you for testing this. This is a big feature for 9.2 so any feedback are welcome. You can use the beta doc page link to see categorical related improvements.

If your going to try with Grouped Bar plot, could you also give feedback about the grouped column plot dialog improvements:
1. A Hint tab is added since some user doesn't know how to fill in the dialog, and the relation of group list and axis tick label tables.

2. Renamed some controls in the dialog.

3. Default graph with have fill color indexed to some group by default.




Sincerely,
Snow Li
OriginLab Corp.

Edited by - snowli on 07/30/2014 12:29:17 PM
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