Question: Code Statistics

07.02.2018, 19:32

Hello all,

I have a series of coded documents.

Each document has been assigned the variables:

  1. Document Set
  2. Year
  3. Year Quarter

I would like to export the number of times a code appears for each quarter in each year.

For example:

For Document Set A
QUART:| 1, 2, 3, 4 | 1, 2, 3, 4 | ...
Code A | 1, 5, 3, 5 | 9, 4, 1, 3 | ...
Code B | 7, 0, 1, 4 | 5, 8, 3, 1 | ...

Is this possible, and how can it be achieved?

I want to avoid having to activate documents by variables for every quarter I want to export, because that would take a very, very long time (I have 25 years worth of documents with 4 quarters across 4 sets, meaning I would need to export 400 different Excel files before combining them all together)!

Many thanks!

Version: MAXQDA 2018
System: Mac OS X 10.13 (High Sierra)
Posts: 30
Joined: 30.12.2017, 11:22

Re: Question: Code Statistics

08.02.2018, 10:35

Hello caledavis,

yes, that is indeed possible! The tool that will help us to do this is called "Crosstab" and can be found in the Mixed Methods Section. But first we need to put your two variables together. I would do it like this:

0) Make a copy of your project file (it's always a good idea)
1) Go to the tab "Variables" and select "Data editor for document variables"
2) Export your data to excel
3) Open the .xlsx-file in excel, add an additional column, and combine your two variables into a new variable with the formular seen in the attached screenshot

4) Import the excel sheet again (this will simply add the new variable)
5) Go to "Mixed Methods" > "Crosstab"; select the new variable on the left side, and on the bottom, check the option "insert all variable values as conditions"
6) Tadaa!
makeanewvariable.png (24.19 KiB) Viewed 6950 times
MAXQDA Support Team
Andreas V.
Posts: 274
Joined: 13.04.2017, 16:23

Re: Question: Code Statistics

15.02.2018, 14:16

Dear Andreas

Thanks for this useful suggestion—it's much more elegant (and faster!) than my alternative of outputting crosstab data for the quarters after activating documents based on document set and year. The Excel tip was greatly appreciated: it has never occurred to me to use Excel to concatenate a string and then reimport it as a new variable.

I have discovered two quirks where the suggested method creates problems:
  1. Inserting 'All Variables As Conditions' does not insert them in alphabetical or numerical order; requiring the output to be sorted by column in Excel (which isn't really a problem, but an extra step to order the data correctly)—it would be great if when inserting all variables as conditions one could sort the variables;
  2. Inserting 'All Variables As Conditions' will not (obviously) import a variable that does not exist. So, if there is a quarter where there is [I]no[/I] data, 'All Variables As Conditions' will simply not insert that variable. This means the outputted crosstab spreadsheet will have holes (for example: 2000-01; 2000-02; 2000-04; 2001-01...) requiring the manual addition of columns later on to make up for the missing variable (in this example, 2000-03).
Posts: 30
Joined: 30.12.2017, 11:22

Re: Question: Code Statistics

19.02.2018, 13:03

Dear caledavis,

thank you for your feedback! Indeed, sorting by name or date would be handy! I'm not really sure what we can do with the second point, but maybe the development team has an idea. I will forward this to our wishlist for further improvements.
Thanks again!
Kind regards,

MAXQDA Support Team
Andreas V.
Posts: 274
Joined: 13.04.2017, 16:23

Re: Question: Code Statistics

22.02.2018, 10:34

Hi Andreas,

In my mind a solution to the second issue would be adding a new variable type of "list", whereby the user can input a list of valid entries for a list and then the variable must be one of those entries. That way MAXQDA would know all of the potential values for that variable.

That would also create some complexities for importing data from Excel, but might also be able to be overcome by using Excel's data validation tool (which could also mean, when MAXQDA exports variables to Excel, it exports two sheets in the workbook: one for the variables options, and a second containing the valid entries for a specific variable column).
Posts: 30
Joined: 30.12.2017, 11:22

Return to MAXQDA in Research

Who is online

Users browsing this forum: No registered users and 1 guest

We use cookies to improve your experience on our website. By clicking OK or by continuing to browse the website, we’ll assume that you are happy with their use. Click here to review our Cookie Policy. OK